§
    O�’jK
  ã            
       óž   — d dl mZ d dlmZ d dlmZmZ deeef         dedeeef         fd„Z	ded	ed
ee
dz  ee
dz  egef         defd„ZdS )é    )ÚCallable)ÚAny)ÚContextÚTreeSpecÚuser_kwargsÚspecÚreturnc                 óÎ  — |j         t          urt          d|j         › �¦  «        ‚|j        dk    rt          d|j        › �¦  «        ‚|                     d¦  «        }|j         t
          urt          d|j         › �¦  «        ‚t          | ¦  «        t          |j        ¦  «        k    r't          dt          | ¦  «        › d|j        › �¦  «        ‚i }|j        D ]}| |         ||<   Œ|S )aX  Reorder user-provided kwargs to match the order in `spec`. `spec` is
    expected to be the in_spec of an exported program, i.e. the spec that
    results from flattening `(args, kwargs)`.

    We need this to provide consistent input ordering, such so that users can
    pass in foo(a=a, b=b) OR foo(b=b, a=a) and receive the same result.
    z(Expected spec type to be tuple, but got é   z*Expected spec to have 2 children, but got é   z.Expected kwargs_spec type to be dict, but got z>Ran into a kwarg keyword mismatch: Got the following keywords z but expected )
ÚtypeÚtupleÚAssertionErrorÚnum_childrenÚchildÚdictÚsetÚcontextÚ
ValueErrorÚlist)r   r   Úkwargs_specÚreordered_kwargsÚkws        úFC:\Projects\DSCons\.venv\Lib\site-packages\torch\export\_tree_utils.pyÚreorder_kwargsr      s*  € ð „y�ÐÐÝÐSÈÌ	ÐSÐSÑTÔTÐTØÔ˜AÒÐÝØL¸Ô9JÐLÐLñ
ô 
ð 	
ð —*’*˜Q‘-”-€KØÔ�tÐ#Ð#ÝØO¸[Ô=MÐOÐOñ
ô 
ð 	
õ ˆ;ÑÔ�3˜{Ô2Ñ3Ô3Ò3Ð3ÝðaÝ*.¨{Ñ*;Ô*;ðað aØKVÔK^ðað añ
ô 
ð 	
ð
 ÐØÔ!ð /ð /ˆØ*¨2œÐ˜ÑÐàÐó    Úspec1Úspec2Úequivalence_fnNc                 ó  —  || j         | j        |j         |j        ¦  «        sdS | j        |j        k    rdS t          |                      ¦   «         |                     ¦   «         ¦  «        D ]\  }}t          |||¦  «        s dS ŒdS )a,  Customizable equivalence check for two TreeSpecs.

    Arguments:
        spec1: The first TreeSpec to compare
        spec2: The second TreeSpec to compare
        equivalence_fn: A function to determine the equivalence of two
            TreeSpecs by examining their types and contexts. It will be called like:

                equivalence_fn(spec1.type, spec1.context, spec2.type, spec2.context)

            This function will be applied recursively to all children.

    Returns:
        True if the two TreeSpecs are equivalent, False otherwise.
    FT)r   r   r   ÚzipÚchildrenÚis_equivalent)r   r   r   Úchild_spec1Úchild_spec2s        r   r#   r#   )   sš   € ð( ˆ>˜%œ* e¤m°U´ZÀÄÑOÔOð Øˆuð Ô˜UÔ/Ò/Ð/Øˆuå$'¨¯ªÑ(8Ô(8¸%¿.º.Ñ:JÔ:JÑ$KÔ$Kð ð Ñ ˆ�[Ý˜[¨+°~ÑFÔFð 	Ø�5�5ð	ð ˆ4r   )Úcollections.abcr   Útypingr   Útorch.utils._pytreer   r   r   Ústrr   r   Úboolr#   © r   r   ú<module>r,      sØ   ðØ $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1ð  S¨# X¤ð °hð À4ÈÈSÈÄ>ð ð ð ð ðDØðàðð ˜d T™k¨7°D¸4±KÀÐIÈ4ÐOÔPðð 
ð	ð ð ð ð ð r   