ó
    "Eñi�  ã                   óŽ   • S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  SS/r
\" SS	S
9rS r\" S5       " S S\\   5      5       rg)é    )ÚCallable)ÚTypeVar)Úfunctional_datapipe)ÚMapDataPipe)Ú_check_unpickable_fnÚMapperMapDataPipeÚ
default_fnÚ_T_coT)Ú	covariantc                 ó   • U $ ©N© )Údatas    Úd/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/data/datapipes/map/callable.pyr	   r	      s   € Ø€Kó    Úmapc                   ót   ^ • \ rS rSr% Sr\\S'   \\S'   \4S\S\SS4U 4S jjjr	S\
4S jrS\4S	 jrS
rU =r$ )r   é   aÄ  
Apply the input function over each item from the source DataPipe (functional name: ``map``).

The function can be any regular Python function or partial object. Lambda
function is not recommended as it is not supported by pickle.

Args:
    datapipe: Source MapDataPipe
    fn: Function being applied to each item

Example:
    >>> # xdoctest: +SKIP
    >>> from torchdata.datapipes.map import SequenceWrapper, Mapper
    >>> def add_one(x):
    ...     return x + 1
    >>> dp = SequenceWrapper(range(10))
    >>> map_dp_1 = dp.map(add_one)
    >>> list(map_dp_1)
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    >>> map_dp_2 = Mapper(dp, lambda x: x + 1)
    >>> list(map_dp_2)
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ÚdatapipeÚfnÚreturnNc                 óP   >• [         TU ]  5         Xl        [        U5        X l        g r   )ÚsuperÚ__init__r   r   r   )Úselfr   r   Ú	__class__s      €r   r   ÚMapperMapDataPipe.__init__4   s"   ø€ ô
 	‰ÑÔØ ŒÜ˜RÔ Ø�r   c                 ó,   • [        U R                  5      $ r   )Úlenr   )r   s    r   Ú__len__ÚMapperMapDataPipe.__len__>   s   € ä�4—=‘=Ó!Ð!r   c                 ó>   • U R                  U R                  U   5      $ r   )r   r   )r   Úindexs     r   Ú__getitem__ÚMapperMapDataPipe.__getitem__B   s   € Ø�w‰w�t—}‘} UÑ+Ó,Ð,r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__r   r	   r   Úintr    r
   r$   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s]   ø‡ ñð0 ÓØƒLð
 "ñàðð ðð 
÷	ð ð"˜ô "ð- E÷ -ò -r   N)Úcollections.abcr   Útypingr   Ú%torch.utils.data.datapipes._decoratorr   Ú#torch.utils.data.datapipes.datapiper   Ú'torch.utils.data.datapipes.utils.commonr   Ú__all__r
   r	   r   r   r   r   Ú<module>r5      sX   ðå $Ý å EÝ ;Ý Hð  Ð
-€ñ 	� 4Ñ(€òñ �UÓô+-˜ EÑ*ó +-ó ñ+-r   