ó
    "Eñi÷  ã            	       óô   • S SK r S SKrS SKrS SKJr  S SKJr  S SKJrJ	r	  SS/r
\\	-  r\\\\S4   4   rS\4S	 jrS
\S\S\\   S\\   4S jrS\S\4S jrSS\S\S-  S\4S jjrS\S\S\\   S\4S jrg)é    N)Ú
Collection)Údill_available)ÚIterDataPipeÚMapDataPipeÚtraverseÚtraverse_dpsÚDataPipeGraphÚreturnc                  ó   • g)NÚSTUB© r   ó    ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/utils/data/graph.pyÚ_stub_unpicklerr      s   € Ør   Úscan_objÚonly_datapipeÚcachec                 ó>  ^ ^^• [         R                  " 5       n[        R                  " U5      n[	        5       (       a  SSKJn  U" U5      nOS n/ mS nUUU 4S jn[        [        4n	 U	 H.  n
U
R                  U5        U(       d  M  U
R                  U5        M0      UR                  T 5        U	 H.  n
U
R                  S 5        U(       d  M  U
R                  S 5        M0     [	        5       (       a  SSKJn  U" S5        T$ ! [        R                  [        [        4 a$    [	        5       (       a  UR                  T 5         N”e f = f! U	 H.  n
U
R                  S 5        U(       d  M  U
R                  S 5        M0     [	        5       (       a  SSKJn  U" S5        f f = f)Nr   )ÚPicklerc                 ó´  • S n[        U [        5      (       aC  0 nU R                  5        H+  u  p#[        U[        [        [
        45      (       d  M'  X1U'   M-     U$ [        U [        [        45      (       a@  / nU  H6  n[        U[        [        [
        45      (       d  M%  UR                  U5        M8     U$ [        U [        [        [
        45      (       a  U nU$ ©N)	Ú
isinstanceÚdictÚitemsr   r   r   ÚtupleÚlistÚappend)Ú	ori_stateÚstateÚkÚvs       r   Úgetstate_hookÚ0_list_connected_datapipes.<locals>.getstate_hook&   s¶   € ØˆÜ�i¤×&Ñ&ØˆEØ!Ÿ™Ö)‘�Ü˜a¤,´¼ZÐ!H×IÓIØ ˜!“Hñ *ð ˆô ˜	¤E¬4 =×1Ñ1ØˆEÛ�Ü˜a¤,´¼ZÐ!H×IÓIØ—L‘L –Oñ ð
 ˆô ˜	¤L´+¼zÐ#J×KÑKØˆEØˆr   c                 ó    >• U T:X  d  [        U 5      T;   a  [        eTR                  U 5        TR                  [        U 5      5        [        S4$ )Nr   )ÚidÚNotImplementedErrorr   Úaddr   )Úobjr   Úcaptured_connectionsr   s    €€€r   Úreduce_hookÚ._list_connected_datapipes.<locals>.reduce_hook6   sD   ø€ Ø�(‹?œb ›g¨Ó.Ü%Ð%à ×'Ñ'¨Ô,à�I‰I”b˜“gÔÜ" BÐ&Ð&r   )ÚextendF)ÚioÚBytesIOÚpickler   r   Údillr   r   Úset_reduce_ex_hookÚset_getstate_hookÚdumpÚPickleErrorÚAttributeErrorÚ	TypeErrorr,   )r   r   r   ÚfÚpÚdill_PicklerÚdr"   r*   Údatapipe_classesÚclsÚdill_extendr)   s   ` `         @r   Ú_list_connected_datapipesr>      sc  ú€ ô 	�
Š
‹€AÜ�ŠØ	ó	€Aô ×ÑÝ0á˜‹O‰àˆàÐò÷ 'ô 0<¼[Ð.IÐðÛ#ˆCØ×"Ñ" ;Ô/ßˆ}Ø×%Ñ% mÖ4ñ $ð	Ø�F‰F�8Ôó $ˆCØ×"Ñ" 4Ô(ßˆ}Ø×%Ñ% dÖ+ñ $ô ×ÑÝ2á˜ÔØÐøô ×"Ñ"¤N´IÐ>ó 	Ü×Ñà—‘�xÖ àð	ûó $ˆCØ×"Ñ" 4Ô(ßˆ}Ø×%Ñ% dÖ+ñ $ô ×ÑÝ2á˜Õð ús6   Á)E ÂE ÂD Ä?EÅE ÅEÅE ÅFÅ(4FÚdatapipec                 ó,   • [        5       n[        U SUS9$ )aÅ  
Traverse the DataPipes and their attributes to extract the DataPipe graph.

This only looks into the attribute from each DataPipe that is either a
DataPipe and a Python collection object such as ``list``, ``tuple``,
``set`` and ``dict``.

Args:
    datapipe: the end DataPipe of the graph
Returns:
    A graph represented as a nested dictionary, where keys are ids of DataPipe instances
    and values are tuples of DataPipe instance and the sub-graph
T)r   r   )ÚsetÚ_traverse_helper)r?   r   s     r   r   r   Z   s   € ô “e€EÜ˜H°DÀÑFÐFr   c                 óˆ   • SnU(       d  US-  n[         R                  " U[        SS9  Uc  Sn[        5       n[	        XU5      $ )aú  
Traverse the DataPipes and their attributes to extract the DataPipe graph.

[Deprecated]
When ``only_dataPipe`` is specified as ``True``, it would only look into the
attribute from each DataPipe that is either a DataPipe and a Python collection object
such as ``list``, ``tuple``, ``set`` and ``dict``.

Note:
    This function is deprecated. Please use `traverse_dps` instead.

Args:
    datapipe: the end DataPipe of the graph
    only_datapipe: If ``False`` (default), all attributes of each DataPipe are traversed.
      This argument is deprecating and will be removed after the next release.
Returns:
    A graph represented as a nested dictionary, where keys are ids of DataPipe instances
    and values are tuples of DataPipe instance and the sub-graph
zV`traverse` function and will be removed after 1.13. Please use `traverse_dps` instead.zM And, the behavior will be changed to the equivalent of `only_datapipe=True`.é   )Ú
stacklevelF)ÚwarningsÚwarnÚFutureWarningrA   rB   )r?   r   Úmsgr   s       r   r   r   l   sK   € ð*	-ð ö ØÐ^Ñ^ˆÜ‡M‚M�#”}°Ò3ØÑØˆÜ“e€EÜ˜H°UÓ;Ð;r   c           	      ó^  • [        U [        [        45      (       d  [        S[	        U 5       S35      e[        U 5      nX2;   a  0 $ UR                  U5        [        XUR                  5       5      nX00 40nU H1  nXS   S   R                  [        XaUR                  5       5      5        M3     U$ )Nz.Expected `IterDataPipe` or `MapDataPipe`, but z	 is foundé   )r   r   r   ÚRuntimeErrorÚtyper%   r'   r>   ÚcopyÚupdaterB   )r?   r   r   Údp_idr   r:   Úitems          r   rB   rB   Ž   s¨   € ô �h¤¬{Ð ;×<Ñ<ÜØ<¼TÀ(»^Ð<LÈIÐVó
ð 	
ô ˆx‹L€EØƒ~Øˆ	Ø	‡I�IˆeÔä% h¸u¿z¹z»|ÓL€EØ¨"˜~Ð.€AÛˆð 	
‰�‰×ÑÔ+¨DÀÇÁÃÓNÖOñ	 ð
 €Hr   r   )r-   r/   rF   Úcollections.abcr   Útorch.utils._import_utilsr   Ú#torch.utils.data.datapipes.datapiper   r   Ú__all__ÚDataPiper   Úintr   r	   Ústrr   ÚboolrA   r   r>   r   r   rB   r   r   r   Ú<module>rZ      sã   ðã 	Û Û Ý &å 4ß Ið �~Ð
&€à˜+Ñ%€Ø�S˜% ¨/Ð 9Ñ:Ð:Ñ;€ð˜ô ð
A ØðA Ø'+ðA Ø47¸±HðA à	ˆ(�^ôA ðHG˜8ð G¨ô Gñ$<�xð <°°t±ð <À}õ <ðDØðØ'+ðØ47¸±Hðàõr   