Ë
    ùÿæi÷  ã            	       óè   — d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm	Z	 ddgZ
ee	z  Zeeeedf   f   Zdefd	„Zd
ededee   dee   fd„Zdedefd„Zddededz  defd„Zdededee   defd„Zy)é    N)Ú
Collection)Údill_available)ÚIterDataPipeÚMapDataPipeÚtraverseÚtraverse_dpsÚDataPipeGraphÚreturnc                   ó   — y)NÚSTUB© r   ó    úk/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/torch/utils/data/graph.pyÚ_stub_unpicklerr      s   € Ør   Úscan_objÚonly_datapipeÚcachec                 óà  ‡ ‡‡— t        j                  «       }t        j                  |«      }t	        «       rddlm}  ||«      }nd }g Šd„ }ˆˆˆ fd„}t        t        f}		 |	D ]'  }
|
j                  |«       |sŒ|
j                  |«       Œ) 	 |j                  ‰ «       |	D ]'  }
|
j                  d «       |sŒ|
j                  d «       Œ) t	        «       rddlm}  |d«       ‰S # t        j                  t        t        f$ r  t	        «       r|j                  ‰ «       n‚ Y Œƒw xY w# |	D ]'  }
|
j                  d «       |sŒ|
j                  d «       Œ) t	        «       rddlm}  |d«       w w xY w)Nr   )ÚPicklerc                 óz  — d }t        | t        «      r=i }| j                  «       D ]&  \  }}t        |t        t        t
        f«      sŒ"|||<   Œ( |S t        | t        t        f«      r8g }| D ]/  }t        |t        t        t
        f«      sŒ|j                  |«       Œ1 |S t        | t        t        t
        f«      r| }|S ©N)	Ú
isinstanceÚdictÚitemsr   r   r   ÚtupleÚlistÚappend)Ú	ori_stateÚstateÚkÚvs       r   Úgetstate_hookz0_list_connected_datapipes.<locals>.getstate_hook&   s«   € ØˆÜ�i¤Ô&ØˆEØ!Ÿ™Ö)‘��1Ü˜a¤,´¼ZÐ!HÕIØ �E˜!’Hð *ð ˆô ˜	¤E¬4 =Ô1ØˆEÛ�Ü˜a¤,´¼ZÐ!HÕIØ—L‘L •Oð ð
 ˆô ˜	¤L´+¼zÐ#JÔKØˆEØˆr   c                 óš   •— | ‰k(  st        | «      ‰v rt        ‚‰j                  | «       ‰j                  t        | «      «       t        dfS )Nr   )ÚidÚNotImplementedErrorr   Úaddr   )Úobjr   Úcaptured_connectionsr   s    €€€r   Úreduce_hookz._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<      sV  ú€ ô 	�
‰
‹€AÜ�‰Ø	ó	€Aô ÔÝ0á˜‹O‰àˆàÐòö 'ô 0<¼[Ð.IÐðÛ#ˆCØ×"Ñ" ;Ô/ÚØ×%Ñ% mÕ4ð $ð	Ø�F‰F�8Ôó $ˆCØ×"Ñ" 4Ô(ÚØ×%Ñ% dÕ+ð $ô ÔÝ2á˜ÔØÐøô ×"Ñ"¤N´IÐ>ò 	ÜÔà—‘�xÕ àñ !ð	ûó $ˆCØ×"Ñ" 4Ô(ÚØ×%Ñ% dÕ+ð $ô ÔÝ2á˜Õð ús6   Á!D& Á:D& ÂC% Ã%;D#Ä D& Ä"D#Ä#D& Ä&E-Å -E-Údatapipec                 ó2   — t        «       }t        | d|¬«      S )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                 ó‚   — d}|s|dz  }t        j                  |t        d¬«       |€d}t        «       }t	        | ||«      S )a6  
    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ÚFutureWarningr?   r@   )r=   r   Úmsgr   s       r   r   r   l   sM   € ð*	-ð ñ ØÐ^Ñ^ˆÜ‡M�M�#”}°Õ3ØÐØˆÜ“e€EÜ˜H m°UÓ;Ð;r   c           	      óV  — t        | t        t        f«      st        dt	        | «      › d�«      ‚t        | «      }||v ri S |j                  |«       t        | ||j                  «       «      }|| i fi}|D ]2  }||   d   j                  t        |||j                  «       «      «       Œ4 |S )Nz.Expected `IterDataPipe` or `MapDataPipe`, but z	 is foundé   )r   r   r   ÚRuntimeErrorÚtyper$   r&   r<   ÚcopyÚupdater@   )r=   r   r   Údp_idr   r8   Úitems          r   r@   r@   Ž   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-   rD   Úcollections.abcr   Útorch.utils._import_utilsr   Ú#torch.utils.data.datapipes.datapiper   r   Ú__all__ÚDataPiper   Úintr   r	   Ústrr   Úboolr?   r   r<   r   r   r@   r   r   r   Ú<module>rX      sã   ðã 	Û Û Ý &å 4ß Ið �~Ð
&€à˜+Ñ%€Ø�S˜% ¨/Ð 9Ñ:Ð:Ñ;€ð˜ó ð
A ØðA Ø'+ðA Ø47¸±HðA à	ˆ(�^óA ðHG˜8ð G¨ó Gñ$<�xð <°°t±ð <À}ó <ðDØðØ'+ðØ47¸±Hðàôr   