ó
    "Eñi=  ã                   ór   • S SK r S SKrS SKJrJrJr  S SKJr  S SKJ	r	  \" S5      r
S/r " S S\	\
   5      rg)é    N)ÚIterableÚIteratorÚSized)ÚTypeVar)ÚIterDataPipeÚ_TÚIterableWrapperIterDataPipec                   óZ   • \ rS rSrSrSS\\   S\SS4S jjrS\	\   4S jr
S\4S	 jrS
rg)r	   é   a±  
Wraps an iterable object to create an IterDataPipe.

Args:
    iterable: Iterable object to be wrapped into an IterDataPipe
    deepcopy: Option to deepcopy input iterable object for each
        iterator. The copy is made when the first element is read in ``iter()``.

.. note::
    If ``deepcopy`` is explicitly set to ``False``, users should ensure
    that the data pipeline doesn't contain any in-place operations over
    the iterable instance to prevent data inconsistency across iterations.

Example:
    >>> # xdoctest: +SKIP
    >>> from torchdata.datapipes.iter import IterableWrapper
    >>> dp = IterableWrapper(range(10))
    >>> list(dp)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
ÚiterableÚdeepcopyÚreturnNc                 ó   • Xl         X l        g )N)r   r   )Úselfr   r   s      Úb/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/data/datapipes/iter/utils.pyÚ__init__Ú$IterableWrapperIterDataPipe.__init__$   s   € Ø ŒØ �ó    c              #   óê   #   • U R                   nU R                  (       a!   [        R                  " U R                   5      nU S h  v•N   g ! [         a    [        R
                  " SSS9   N,f = f N*7f)NzlThe input iterable can not be deepcopied, please be aware of in-place modification would affect source data.é   )Ú
stacklevel)r   r   ÚcopyÚ	TypeErrorÚwarningsÚwarn)r   Úsource_datas     r   Ú__iter__Ú$IterableWrapperIterDataPipe.__iter__(   sb   é € Ø—m‘mˆØ�=�=ðÜ"Ÿmšm¨D¯M©MÓ:�ð ×Ñøô ó Ü—’ðYà ôðúñ 	ùs4   ‚A3¡ A ÁA3ÁA1ÁA3ÁA.Á+A3Á-A.Á.A3c                 ó¬   • [        U R                  [        5      (       a  [        U R                  5      $ [	        [        U 5      R                   S35      e)Nz# instance doesn't have valid length)Ú
isinstancer   r   Úlenr   ÚtypeÚ__name__)r   s    r   Ú__len__Ú#IterableWrapperIterDataPipe.__len__9   s@   € Ü�d—m‘m¤U×+Ñ+Ü�t—}‘}Ó%Ð%Üœ4 ›:×.Ñ.Ð/Ð/RÐSÓTÐTr   )r   r   )T)r#   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Úboolr   r   r   Úintr$   Ú__static_attributes__© r   r   r	   r	      sC   † ññ*! ¨"¡ð !¸ð !Èõ !ð˜( 2™,ô ð"U˜÷ Ur   )r   r   Úcollections.abcr   r   r   Útypingr   Ú#torch.utils.data.datapipes.datapiper   r   Ú__all__r	   r-   r   r   Ú<module>r2      s=   ðÛ Û ß 5Ñ 5Ý å <ñ ˆTƒ]€à(Ð
)€ô.U ,¨rÑ"2õ .Ur   