Ë
    øÿæi±Ô  ã                   ó¸  — U d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlZddlZddlmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlZddl Zddl!m"c m#Z$ ddl%m&Z& ddl'm&Z(m)Z* ddl+m,Z,m-Z-m.Z. ddl/m)Z)  G d	„ d
e«      Z0 ed«      Z1 ed«      Z2ejf                  Z4e5e6e5df   z  e7d<   e5e7d<   	 ddl8Z8e8jr                  Z9 ejx                  «       Z=de7d<   dZ>de?fd„Z@ G d„ d«      ZA eA«       ZB eCdd«      D ]  ZDeB eE«       deD› �<   Œ de?fd„ZFdpdeGfd„ZH G d„ d«      ZI eI«       ZJde0deeGgef   fd„ZKdqd eLdeeGgef   fd!„ZMd"„ ZNdeeGgef   fd#„ZOde?fd$„ZPdeQeG   fd%„ZRd&„ ZSd'„ ZTd(e5deeGgef   fd)„ZUd*„ ZV G d+„ d,«      ZWd-ee1e2f   dee1e2f   fd.„ZXd-ee1e2f   dee1e2f   fd/„ZY G d0„ d1ej´                  «      Z[drd2„Z\d-ee1e2f   dee1e2f   fd3„Z]d-ee1e2f   dee1e2f   fd4„Z^d5„ Z_de?fd6„Z`de?fd7„Zade?fd8„Zbde?fd9„Zcd:„ Zdd;„ Zedsd<„Zfi ageheGeQe   f   e7d=<   d>Zid?„ Zjd@„ ZkdA„ ZldB„ ZmdsdC„Znde6eGeLf   fdD„Zoi apeheGeheGeQe   f   f   e7dE<   i Zqehe6eGeGf   eLf   e7dF<   dG„ ZrdH„ Zsde?fdI„Ztde?fdJ„Zude?fdK„ZvdL„ ZwdM„ Zxde?fdN„Zyde?fdO„Zzejö                  jø                  jû                  «       rddPl~mZ ddQl m€Z€ de?fdR„Z�de?fdS„Z‚nde?fdT„Z‚dU„ Zƒ	 	 dtdVe�j                  �j
                  �j                  dz  fdW„Z‡dXeGdYeQeG   dZe6edf   fd[„Zˆe�j                  d\„ «       ZŠdsd]„Z‹de?fd^„ZŒdsd_„Z�ehd`eQdae6dbej$                  dcej.                  ddej0                  deej4                  dfiZŽdsdg„Z�dsdh„Z�de?fdi„Z‘de?fdj„Z’ G dk„ dle�j&                  «      Z”dm„ Z•deGdz  fdn„Z–e	�j.                  dok\  ry e]e�j0                  �j2                  «        e]e�j0                  �j4                  «        e]e�j0                  �j6                  «        e]e�j0                  �j8                  «       yy# e:$ r ddl;Z;e;jr                  Z9Y �Œ{w xY w)uzº
The weak_script annotation needs to be here instead of inside torch/jit/ so it
can be used in other places in torch/ (namely torch.nn) without running into
circular dependency problems
é    N)ÚAnyÚCallableÚDictÚFinalÚ
ForwardRefÚget_argsÚ
get_originÚListÚOptionalÚProtocolÚTupleÚTypeVarÚUnion)Ú	ParamSpec)Ú_Await)r   ÚFuture)Ú
fake_rangeÚget_source_lines_and_fileÚ	parse_def)r   c                   ó   — e Zd Zdedefd„Zy)Ú
HasGetattrÚkeyÚreturnc                  ó   — y ©N© )Úselfr   s     úh/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/torch/_jit_internal.pyÚ__getattr__zHasGetattr.__getattr__6   s   € ¨Có    N©Ú__name__Ú
__module__Ú__qualname__Ústrr   r   r   r    r   r   r   5   s   „ Ø/˜sÐ/ sÔ/r    r   Ú_PÚ_R.ÚBuiltinUnionTypeÚLockTypez8weakref.WeakKeyDictionary[Callable, dict[str, Callable]]Úboolean_dispatchedÚ__torch_jit_dataclassr   c                 ó–   — t        | d«      xr< | j                  dv xr, t        | «      t        u xs t	        | t        t        «      «      S )Nr#   >   ÚtypingÚtyping_extensions)Úhasattrr#   r	   r   Ú
isinstanceÚtype©Úanns    r   Úis_finalr4   R   sF   € ä��\Ó"ò 	GØ�N‰NÐ=Ð=ò	Gä˜‹_¤Ð%ÒE¬°C¼¼e»Ó)Eðr    c                   ó   — e Zd Zd„ Zy)ÚBroadcastingListClsc                  ó   — y r   r   )r   Útypess     r   Ú__getitem__zBroadcastingListCls.__getitem__\   s   € Ør    N)r"   r#   r$   r9   r   r    r   r6   r6   [   s   „ ór    r6   é   é   ÚBroadcastingListc                   ó   — y)aö  
    Function that returns True when in compilation and False otherwise. This
    is useful especially with the @unused decorator to leave code in your
    model that is not yet TorchScript compatible.
    .. testcode::

        import torch

        @torch.jit.unused
        def unsupported_linear_op(x):
            return x

        def linear(x):
            if torch.jit.is_scripting():
                return torch.linear(x)
            else:
                return unsupported_linear_op(x)
    Fr   r   r    r   Úis_scriptingr>   g   s   € ð& r    c                 ó`  — t        | d«      r| j                  S t        | t        j                  j
                  «      r| j                  S t        | dd «      r| j                  }n2t        | t        j                  «      r| j                  }nt        d«      ‚|dk(  rd}| j                  }|dk(  r| j                  S |€t        d|› d�«      ‚t        j                  |«      r$|j!                  d	d
«      }|j!                  dd
«      }|r|dk(  rd}nd|z   }d|v rt        d|› d|› d�«      ‚|dz   |z   S )NÚ_jit_override_qualnamer"   z)Could not get name of python class objectz<lambda>Ú_lambdaztorch._classesz(Could not get qualified name for class 'z': __module__ can't be None.Ú<Ú_Ú>Ú__main__Ú	__torch__z
__torch__.Ú.z': 'z' is not a valid identifier)r/   r@   r0   ÚtorchÚ_CÚScriptFunctionÚqualified_nameÚgetattrr"   ÚenumÚEnumÚnameÚRuntimeErrorr#   Úpackage_manglingÚ
is_mangledÚreplace)ÚobjÚmangle_namerO   Úmodule_names       r   Ú_qualified_namerW   ~   sW  € ô ˆsÐ,Ô-Ø×)Ñ)Ð)ä�#”u—x‘x×.Ñ.Ô/Ø×!Ñ!Ð!äˆs�J Ô%Ø�|‰|‰ä	�CœŸ™Ô	#Ø�x‰x‰äÐFÓGÐGàˆzÒØˆà—.‘.€Kð Ð&Ò&Ø×!Ñ!Ð!ð ÐÜØ6°t°fð =(ð (ó
ð 	
ô ×"Ñ" ;Ô/Ø!×)Ñ)¨#¨sÓ3ˆØ!×)Ñ)¨#¨sÓ3ˆñ à˜*Ò$Ø%‰Kð '¨Ñ4ˆKà
ˆd�{ÜØ6°t°fð =ØˆvÐ0ð2ó
ð 	
ð
 ˜Ñ˜tÑ#Ð#r    c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚSourceLoaderc                 ó   — i | _         y r   ©Úcontent©r   s    r   Ú__init__zSourceLoader.__init__Å   s	   € Øˆ�r    c                 ó"   — || j                   |<   y r   r[   )r   ÚfnÚsources      r   ÚcachezSourceLoader.cacheÈ   s   € Ø!ˆ�‰�RÒr    c                 ó8   — | j                   j                  |«      S r   )r\   Úget)r   r`   s     r   Ú
get_sourcezSourceLoader.get_sourceË   s   € Ø�|‰|×Ñ Ó#Ð#r    N)r"   r#   r$   r^   rb   re   r   r    r   rY   rY   Ä   s   „ òò"ó$r    rY   Úlookup_basec                 óÂ   ‡ ‡‡‡— dt         dt        dt        fˆfd„Šdt         dt        dt        t        t        f   fˆˆfd„Šdt         dt        dt        fˆfd„Šˆ ˆfd„S )	a_  
    Creates a resolution callback that will look up qualified names in an
    environment, starting with `lookup_base` for the base of any qualified
    names, then proceeding down the lookup chain with the resolved object.

    You should not use this directly, it should only be used from the other
    createResolutionCallbackFrom* functions.
    rK   Úmoduler   c                 óz   •— d| v r+| j                  dd¬«      \  }}t        ||«      } ‰||«      S t        || «      S )NrG   é   )Úmaxsplit)ÚsplitrL   )rK   rh   ÚbaseÚremaining_piecesÚmodule_valueÚlookupInModules        €r   rp   z7createResolutionCallbackFromEnv.<locals>.lookupInModuleÜ   sM   ø€ Ø�.Ñ Ø%3×%9Ñ%9¸#ÈÐ%9Ó%JÑ"ˆDÐ"Ü" 6¨4Ó0ˆLÙ!Ð"2°LÓAÐAä˜6 >Ó2Ð2r    Úexprc                 ó   •— d}|t        | «      k  r"| |   dvr|dz  }|t        | «      k  r| |   dvrŒ| d | dk(  rd|fS  ‰| d | j                  «       |«      }|€t        d| d | › �«      ‚|t        | «      k(  s| |   dk7  r||fS | |   dk7  rt        d|› d	| |   ›�«      ‚g }| |   d
k7  r5d}|dz  } ‰| |d  |«      \  }}|j                  |«       ||z  }| |   d
k7  rŒ5t        |«      dkD  r|t	        |«         |dz   fS ||d      |dz   fS )Nr   )Ú,Ú[Ú]rj   z()r   zUnresolvable type rt   zexpected '[' at position z, got ru   )ÚlenÚstripÚAssertionErrorÚappendÚtuple)	rq   rh   Úirm   ÚpartsÚpart_lenÚpartrp   ÚparseNestedExprs	          €€r   r   z8createResolutionCallbackFromEnv.<locals>.parseNestedExprä   sg  ø€ ØˆØ”#�d“)Šm  Q¡¨Ñ >Ø�‰FˆAð ”#�d“)Šm  Q¡¨Ò >ð
 ��ˆ8�tÒØ�q�5ˆLá˜d 2 A˜hŸn™nÓ.°Ó7ˆØˆ<Ü Ð#5°d¸2¸A°h°ZÐ!@ÓAÐAØ”�D“	Š>˜T !™W¨š^Ø˜�7ˆNà�‰7�cŠ>Ü Ð#<¸Q¸C¸vÀdÈ1ÁgÀ[Ð!QÓRÐRØˆØ�1‰g˜ŠnØˆHØ�‰FˆAÙ,¨T°!°"¨X°vÓ>‰NˆD�(Ø�L‰L˜ÔØ�‰MˆAð �1‰g˜‹nô ˆu‹:˜Š>Øœ˜e›Ñ% q¨1¡uÐ,Ð,à˜˜a™‘> 1 q¡5Ð(Ð(r    c                 ót   •— 	  ‰| |«      \  }}|t        | «      k7  rt        d«      ‚|S # t        $ r 	 Y y w xY w)Nz;whole expression was not parsed, falling back to c++ parser)rv   rx   Ú	Exception)rq   rh   ÚvalueÚ
len_parsedr   s       €r   Ú	parseExprz2createResolutionCallbackFromEnv.<locals>.parseExpr  sU   ø€ ð	Ù /°°fÓ =ÑˆE�:ØœS ›YÒ&Ü$ØQóð ð ˆLøÜò 	ðñ ð	ús   ƒ&* ª
7¶7c                 ó   •—  ‰| ‰«      S r   r   )rq   rf   r„   s    €€r   Ú<lambda>z1createResolutionCallbackFromEnv.<locals>.<lambda>  s   ø€ ™	 $¨Ô4r    )r%   r   rz   Úint)rf   rp   r„   r   s   `@@@r   ÚcreateResolutionCallbackFromEnvrˆ   Ò   sa   û€ ð3¤sð 3´Cð 3¼Cõ 3ð)œcð )¬3ð )´5¼¼c¸±?ö )ð<œð ¤Sð ¬Sõ ô" 5Ð4r    Ú	frames_upc                 ó  ‡‡— t        j                  «       }d}|| dz   k  r*|€t        d|› �«      ‚|j                  }|dz  }|| dz   k  rŒ*|€t        d«      ‚|j                  Š|j
                  Š G ˆˆfd„d«      }t         |«       «      S )a\  
    Creates a function which, given a string variable name,
    returns the value of the variable in the scope of the caller of
    the function which called createResolutionCallbackFromFrame (by default).

    This is used to enable access in-scope Python variables inside
    TorchScript fragments.

    frames_up is number of additional frames to go up on the stack.
    The default value is 0, which correspond to the frame of the caller
    of createResolutionCallbackFromFrame. Also for example, if frames_up is set
    to 1, then the frame of the caller's caller of createResolutionCallbackFromFrame
    will be taken.

    For example, the following program prints 2::

        def bar():
            cb = createResolutionCallbackFromFrame(1)
            print(cb("foo"))


        def baz():
            foo = 2
            bar()


        baz()
    r   rj   zframe is None at iteration z(frame is None after traversing frames_upc                   ó$   •— e Zd Zdedefˆ ˆfd„Zy)ú.createResolutionCallbackFromFrame.<locals>.envr   r   c                 ól   •— |‰v r‰|   S |‰v r‰|   S |t        t        «      v rt        t        |«      S y r   )ÚdirÚbuiltinsrL   )r   r   Ú	f_globalsÚf_localss     €€r   r   z:createResolutionCallbackFromFrame.<locals>.env.__getattr__A  sD   ø€ Ø�h‰Ø ‘}Ð$Ø˜	Ñ!Ø  ‘~Ð%ØœœH›Ñ%Üœx¨Ó-Ð-ð &r    Nr!   )r�   r‘   s   €€r   ÚenvrŒ   @  s   ø„ ð	. 3ð 	.¨3÷ 	.r    r’   )ÚinspectÚcurrentframerx   Úf_backr‘   r�   rˆ   )r‰   Úframer{   r’   r�   r‘   s       @@r   Ú!createResolutionCallbackFromFramer—     sš   ù€ ô: × Ñ Ó"€EØ	€AØ
ˆi˜!‰mÒ
Øˆ=Ü Ð#>¸q¸cÐ!BÓCÐCØ—‘ˆØ	ˆQ‰ˆð	 ˆi˜!‰mÓ
ð €}ÜÐGÓHÐHØ�~‰~€HØ—‘€I÷.ô .ô +©3«5Ó1Ð1r    c                 óÆ   — i }|j                  | j                  «       t        | j                  j                  «      D ]!  \  }}| j
                  |   j                  ||<   Œ# |S )zC
    Get a dictionary of closed over variables from a function
    )ÚupdateÚ__globals__Ú	enumerateÚ__code__Úco_freevarsÚ__closure__Úcell_contents)r`   ÚcapturesÚindexÚcaptured_names       r   Úget_closurer£   L  sX   € ð €HØ‡O�O�B—N‘NÔ#ä )¨"¯+©+×*AÑ*AÖ BÑˆˆ}Ø"$§.¡.°Ñ"7×"EÑ"Eˆ�Òð !Cð €Or    c                 óR   ‡— t        | «      Š G ˆfd„d«      }t         |«       «      S )z
    Create a resolutionCallback by introspecting the function instead of
    looking up the stack for the enclosing scope
    c                   ó"   •— e Zd Zdedefˆ fd„Zy)ú;createResolutionCallbackFromClosure.<locals>.closure_lookupr   r   c                 ó˜   •— |‰v r‰|   S t        t        |«      rt        t        |«      S t        t        |«      rt        t        |«      S y r   )r/   r-   rL   r�   )r   r   Úclosures     €r   r   zGcreateResolutionCallbackFromClosure.<locals>.closure_lookup.__getattr__�  sE   ø€ Ø�g‰~Ø˜s‘|Ð#Üœ Ô%Üœv sÓ+Ð+Üœ 3Ô'Üœx¨Ó-Ð-Ør    Nr!   )r¨   s   €r   Úclosure_lookupr¦   �  s   ø„ ð	 3ð 	¨3ö 	r    r©   )r£   rˆ   )r`   r©   r¨   s     @r   Ú#createResolutionCallbackFromClosurerª   †  s(   ø€ ô
 ˜"‹o€G÷
ó 
ô +©>Ó+;Ó<Ð<r    c           
      ón  — t        | «      ryt        j                  j                  t        t
        t        f}t        | |«      ry| j                  }|D �cg c].  }t        j                  t        | |d «      «      rt        | |«      ‘Œ0 }}|D �cg c]  }t        |d«      ‘Œ }}t        |«      S c c}w c c}w )NFrœ   )Úis_ignored_fnrH   ÚnnÚModulerz   Úlistr�   Ú
issubclassÚ__dict__r“   Ú	isroutinerL   r/   Úall)ÚclsÚignored_builtin_classesÚnamesrO   Úfnsr`   Úhas_codes          r   Úcan_compile_classr¹   œ  s°   € ô �SÔØô  %Ÿx™xŸ™´´t¼YÐGÐÜ�#Ð.Ô/Øà�L‰L€Eñ óáˆDÜ×ÑœW S¨$°Ó5Ô6ô 	��TÕØð ð ñ
 36Ó6±#¨B”˜˜JÕ'°#€HÐ6Üˆx‹=Ðùòùò
 7s   Á3B-ÂB2c                 óò   — 	 t        j                  | «      }g }|j                  j	                  «       D ]0  \  }}|j
                  |j                  k7  rŒ |j                  |«       Œ2 |S # t        $ r g cY S w xY w)aU  
    Gets names of all POSITIONAL_OR_KEYWORD arguments for callable `fn`.
    Returns an empty list when other types of arguments are present.

    This is used by `torch.jit.trace` to assign meaningful argument names to
    traced functions and modules.

    Args:
        fn: A callable.
    Returns:
        Argument names: List[str]
    )r“   Ú	signaturer�   Ú
parametersÚitemsÚkindÚPOSITIONAL_OR_KEYWORDry   )r`   Úcallable_signatureÚargument_namesrO   Úparams        r   Úget_callable_argument_namesrÃ   ±  s   € ðÜ$×.Ñ.¨rÓ2Ðð €NØ)×4Ñ4×:Ñ:Ö<‰ˆˆeð �:‰:˜×4Ñ4Ò4Øà×Ñ˜dÕ#ð =ð Ðøô ò ØŠ	ðús   ‚A( Á(A6Á5A6c                 óh  — t        | t        j                  «      r| j                  S t        | t        j                  «      r0dj                  t        | j                  «      | j                  g«      S t        | t        j                  «      r0| j                  }t        | j                  «      › dt        |«      › d�S t        | t        j                  «      r2dj                  | j                  D �cg c]  }t        |«      ‘Œ c}«      S t        | t        j                  «      r| j                  › S yc c}w )z‡
    Convert an AST node containing a type annotation to the string present in the source
    that represents the same annotation.
    rG   rt   ru   rs   N)r0   ÚastÚNameÚidÚ	AttributeÚjoinÚget_annotation_strr‚   ÚattrÚ	SubscriptÚslicer   ÚeltsÚConstant)Ú
annotationÚsubscript_sliceÚelts      r   rÊ   rÊ   Ð  sì   € ô
 �*œcŸh™hÔ'Ø�}‰}ÐÜ	�J¤§¡Ô	.Ø�x‰xÔ+¨J×,<Ñ,<Ó=¸z¿¹ÐOÓPÐPÜ	�J¤§¡Ô	.à$×*Ñ*ˆÜ$ Z×%5Ñ%5Ó6Ð7°qÔ9KÈOÓ9\Ð8]Ð]^Ð_Ð_Ü	�J¤§	¡	Ô	*Ø�x‰x¸J¿OºOÓL¹O°SÔ+¨CÕ0¸OÑLÓMÐMÜ	�J¤§¡Ô	-Ø×"Ñ"Ð#Ð$ð ùò Ms   Ã.D/c                 óB  — t         j                  | «      }|€	 t        j                  | «      }t        j
                  | «      }|j                  j                  «       D ��ci c]R  \  }}|j                  t        j                  j                  ur't        |j                  t        «      s||j                  “ŒT }}}t        j                  t        j                   |«      «      }t#        |j$                  «      dk7  s't        |j$                  d   t        j&                  «      st)        d| › d�«      ‚|j$                  d   }i }	|j*                  j*                  D ]A  }
|
j                  rt-        |
j                  «      nd}|€Œ)|
j.                  }||v sŒ:||   |	|<   ŒC t-        |j0                  «      }|du}|j2                  }|t        j                  j                  uxr t        |t        «       }|r|r||	|<   |	S # t        $ r}t	        d| › d�«      |‚d}~ww xY wc c}}w )a¦  
    Get a dictionary containing type resolution mappings necessary to resolve types
    for the literal annotations on 'fn'. These are not considered to be closed-over by fn
    and must be obtained separately (e.g. using this function).

    Args:
        fn: A callable.
    Returns:
        A Dict[str, Any] containing a mapping from the literal annotations used on
        fn to the Python objects they refer to.
    NzFailed to get source for z using inspect.getsourcerj   r   z	Expected z to be a function)Úloaderre   r“   Ú	getsourceÚOSErrorr»   r¼   r½   rÐ   Ú	ParameterÚemptyr0   r%   rÅ   ÚparseÚtextwrapÚdedentrv   ÚbodyÚFunctionDefrP   ÚargsrÊ   ÚargÚreturnsÚreturn_annotation)r`   ÚsrcÚer»   rO   Ú	parameterÚname_to_typeÚaÚfÚannotation_to_typerß   Úarg_annotation_strÚarg_nameÚliteral_return_annotationÚvalid_literal_annotationrá   Úvalid_return_annotation_types                    r   Úget_type_hint_capturesrî   æ  s  € ô  ×
Ñ
˜BÓ
€CØ
€{ð	Ü×#Ñ# BÓ'ˆCô ×!Ñ! "Ó%€Ið  )×3Ñ3×9Ñ9Ô;ôá;‰OˆD�)Ø×Ñ¤w×'8Ñ'8×'>Ñ'>Ñ>Ü˜9×/Ñ/´Ô5ð 	ˆi×"Ñ"Ñ"Ø;ð ñ ô 	�	‰	”(—/‘/ #Ó&Ó'€AÜ
ˆ1�6‰6ƒ{�aÒœz¨!¯&©&°©)´S·_±_ÔEÜ˜Y r dÐ*;Ð<Ó=Ð=Ø	�‰ˆq‰	€Að
 Ðà�v‰v�{Œ{ˆð 36·.².Ô˜sŸ~™~Ô.Àdð 	ð Ð%Øð
 —7‘7ˆØ�|Ò#Ø5AÀ(Ñ5KÐÐ1Ò2ð# ô, !3°1·9±9Ó =ÐØ8ÀÐDÐØ!×3Ñ3Ðà¤×!2Ñ!2×!8Ñ!8Ð8ò 	3ÜÐ,¬cÓ2Ð2ð !ñ  Ñ$@Ø8IÐÐ4Ñ5àÐøôA ò 	ÜØ+¨B¨4Ð/GÐHóàðûð	üós   ™G: Á AHÇ:	HÈHÈHr´   c           	      ó¼  ‡— | j                   D �cg c]-  }t        j                  t        | |«      «      rt        | |«      ‘Œ/ }}|D �cg c]4  }t        j                  |«      st        |d«      r|j                  dk7  r|‘Œ6 }}i Š|D ]6  }‰j                  t        |«      «       ‰j                  t        |«      «       Œ8 dt        dt        fˆfd„}|S c c}w c c}w )zš
    This looks at all the methods defined in a class and pulls their closed-over
    variables into a dictionary and uses that to resolve variables.
    rš   Ú__annotate__r   r   c                 ó8   •— | ‰v r‰|    S t        t        | d «      S r   )rL   r�   )r   r    s    €r   Úlookup_in_classz@createResolutionCallbackForClassMethods.<locals>.lookup_in_classZ  s#   ø€ Ø�(‰?Ø˜C‘=Ð äœ8 S¨$Ó/Ð/r    )r±   r“   r²   rL   Ú	isbuiltinr/   r"   r™   r£   rî   r%   r   )r´   rO   r·   r`   rò   r    s        @r   Ú'createResolutionCallbackForClassMethodsrô   =  sã   ø€ ð —L’Lóá ˆDÜ×ÑœW S¨$Ó/Ô0ô 	��TÕØ ð ð ñ óáˆBÜ× Ñ  Ô$Ü�B˜Ô&Ø�K‰K˜>Ò)ò	 	Øð ð ð €HãˆØ�‰œ B›Ô(Ø�‰Ô.¨rÓ2Õ3ð ð0œSð 0¤Sõ 0ð Ðùò9ùòs   �2CÁ9Cc                 ón  ‡ ‡‡‡‡— ˆˆ ˆˆˆfd„}‰j                   € ‰j                   �‰j                   }|‰_         nR‰j                   € ‰j                   �‰j                   }|‰_         n&‰j                   €‰j                   €d}nt        d«      ‚||_         |�||_        |�||_        ‰‰‰‰‰ dœt        |<   |S )zÖ
    Dispatches to either of 2 script functions based on a boolean argument.
    In TorchScript, the boolean argument must be constant so that the correct
    function to use can be determined at compile time.
    c                  óf   •— ‰}‰|v r|‰   }n‰t        | «      k  r| ‰   }|r ‰| i |¤ŽS  ‰| i |¤ŽS r   )rv   )rÞ   ÚkwargsÚdispatch_flagÚ	arg_indexrê   ÚdefaultÚif_falseÚif_trues      €€€€€r   r`   zboolean_dispatch.<locals>.fnr  sR   ø€ ØˆØ�vÑØ" 8Ñ,‰MØœ˜T›Ò"Ø  ™OˆMáÙ˜DÐ+ FÑ+Ð+á˜TÐ, VÑ,Ð,r    Nz&only one function can have a docstring)rü   rû   r¡   rú   rê   )Ú__doc__rP   r#   r"   r*   )	rê   rù   rú   rü   rû   rV   Ú	func_namer`   Údocs	   `````    r   Úboolean_dispatchr   c  sÈ   ü€ ÷
-ð 
-ð ‡�Ð 8×#3Ñ#3Ð#?Ø×ÑˆØˆ�Ø	×	Ñ	Ð	! g§o¡oÐ&AØ�o‰oˆØˆÕØ	×	Ñ	Ð	! g§o¡oÐ&=à‰äÐCÓDÐDØ€B„JàÐØ#ˆŒØÐØˆŒð ØØØØñÔ�rÑð €Ir    c                   ó(   — e Zd ZdZdZdZdZdZdZdZ	y)	ÚFunctionModifierszn
    Used to denote the behavior of a function in TorchScript. See export() and
    ignore() for details.
    z:unused (ignored and replaced with raising of an exception)z>ignore (leave as a call to Python, cannot be torch.jit.save'd)z7export (compile this function even if nothing calls it)z>default (compile if called from a exported function / forward)zNif this method is not scripted, copy the python method onto the scripted modelzB_drop (function is fully ignored, declaration can be unscriptable)N)
r"   r#   r$   rý   ÚUNUSEDÚIGNOREÚEXPORTÚDEFAULTÚCOPY_TO_SCRIPT_WRAPPERÚ_DROPr   r    r   r  r  š  s.   „ ñð
 J€FØM€FØF€FØN€GàXð ð Q�Er    r  r`   c                 ó0   — t         j                  | _        | S )a  
    This decorator indicates that a method on an ``nn.Module`` is used as an entry point into a
    :class:`ScriptModule` and should be compiled.

    .. deprecated:: 2.5
        Please use :func:`torch.compile` instead.

    ``forward`` implicitly is assumed to be an entry point, so it does not need this decorator.
    Functions and methods called from ``forward`` are compiled as they are seen
    by the compiler, so they do not need this decorator either.

    Example (using ``@torch.jit.export`` on a method):

    .. testcode::

        import torch
        import torch.nn as nn

        class MyModule(nn.Module):
            def implicitly_compiled_method(self, x):
                return x + 99

            # `forward` is implicitly decorated with `@torch.jit.export`,
            # so adding it here would have no effect
            def forward(self, x):
                return x + 10

            @torch.jit.export
            def another_forward(self, x):
                # When the compiler sees this call, it will compile
                # `implicitly_compiled_method`
                return self.implicitly_compiled_method(x)

            def unused_method(self, x):
                return x - 20

        # `m` will contain compiled methods:
        #     `forward`
        #     `another_forward`
        #     `implicitly_compiled_method`
        # `unused_method` will not be compiled since it was not called from
        # any compiled methods and wasn't decorated with `@torch.jit.export`
        m = torch.jit.script(MyModule())
    )r  r  Ú_torchscript_modifier©r`   s    r   Úexportr  ª  s   € ôZ  1×7Ñ7€BÔØ€Ir    c                 ó  — t        | t        «      rZ| }t        |j                  dt        j
                  «       |j                  r%t        |j                  dt        j
                  «       |S t        j
                  | _        | S )a  
    This decorator indicates to the compiler that a function or method should
    be ignored and replaced with the raising of an exception. This allows you
    to leave code in your model that is not yet TorchScript compatible and still
    export your model.

        Example (using ``@torch.jit.unused`` on a method)::

            import torch
            import torch.nn as nn


            class MyModule(nn.Module):
                def __init__(self, use_memory_efficient):
                    super().__init__()
                    self.use_memory_efficient = use_memory_efficient

                @torch.jit.unused
                def memory_efficient(self, x):
                    import pdb

                    pdb.set_trace()
                    return x + 10

                def forward(self, x):
                    # Use not-yet-scriptable memory efficient mode
                    if self.use_memory_efficient:
                        return self.memory_efficient(x)
                    else:
                        return x + 10


            m = torch.jit.script(MyModule(use_memory_efficient=False))
            m.save("m.pt")

            m = torch.jit.script(MyModule(use_memory_efficient=True))
            # exception raised
            m(torch.rand(100))
    r
  )r0   ÚpropertyÚsetattrÚfgetr  r  Úfsetr
  )r`   Úprops     r   Úunusedr  Û  sm   € ôP �"”hÔØˆÜØ�I‰IÐ.Ô0A×0HÑ0Hô	
ð �9Š9ÜØ—	‘	Ð2Ô4E×4LÑ4Lôð ˆä0×7Ñ7€BÔØ€Ir    c                   ó*   — e Zd Zd„ Zdedededdfd„Zy)Ú_IgnoreContextManagerc                  ó   — y r   r   )r   r÷   s     r   r^   z_IgnoreContextManager.__init__  ó   € Ør    Úexc_typeÚ	exc_valueÚ	tracebackr   Nc                  ó   — y r   r   )r   r  r  r  s       r   Ú__exit__z_IgnoreContextManager.__exit__  r  r    )r"   r#   r$   r^   r   r  r   r    r   r  r    s(   „ òð ð °ð Àð Èô r    r  c                 ó8  ‡ — t        ‰ «      r‰ }t        j                  |_        |S t	        ‰ t
        «      st        d‰ › �«      ‚|j                  dd«      }|rt        j                  ddt        ¬«       |Š n‰ rt        j                  ddt        ¬«       ˆ fd„}|S )	aq  
    This decorator indicates to the compiler that a function or method should
    be ignored and left as a Python function. This allows you to leave code in
    your model that is not yet TorchScript compatible. If called from TorchScript,
    ignored functions will dispatch the call to the Python interpreter. Models with ignored
    functions cannot be exported; use :func:`@torch.jit.unused <torch.jit.unused>` instead.

    .. deprecated:: 2.5
        Please use :func:`torch.compile` instead.

    Example (using ``@torch.jit.ignore`` on a method)::

        import torch
        import torch.nn as nn


        class MyModule(nn.Module):
            @torch.jit.ignore
            def debugger(self, x):
                import pdb

                pdb.set_trace()

            def forward(self, x):
                x += 10
                # The compiler would normally try to compile `debugger`,
                # but since it is `@ignore`d, it will be left as a call
                # to Python
                self.debugger(x)
                return x


        m = torch.jit.script(MyModule())

        # Error! The call `debugger` cannot be saved since it calls into Python
        m.save("m.pt")

    Example (using ``@torch.jit.ignore(drop=True)`` on a method):

    .. testcode::

        import torch
        import torch.nn as nn

        class MyModule(nn.Module):
            @torch.jit.ignore(drop=True)
            def training_method(self, x):
                import pdb
                pdb.set_trace()

            def forward(self, x):
                if self.training:
                    self.training_method(x)
                return x

        m = torch.jit.script(MyModule())

        # This is OK since `training_method` is not saved, the call is replaced
        # with a `raise`.
        m.save("m.pt")

    .. testcleanup::

        import os
        os.remove('m.pt')
    zCArgument to @torch.jit.ignore must be a bool or a function but got Údrop_on_exportNz‰ignore(drop_on_export=True) has been deprecated. TorchScript will now drop the function call on compilation. Use torch.jit.unused now. {}r:   )Ú
stacklevelÚcategoryzzignore(True) has been deprecated. TorchScript will now drop the function call on compilation. Use torch.jit.unused now. {}c                 ód   •— ‰rt         j                  | _        | S t         j                  | _        | S r   )r  r  r
  r  )r`   Údrops    €r   Ú	decoratorzignore.<locals>.decorator‚  s0   ø€ ÙÜ'8×'?Ñ'?ˆBÔ$ð ˆ	ô (9×'?Ñ'?ˆBÔ$Øˆ	r    )Úcallabler  r  r
  r0   ÚboolrP   ÚpopÚwarningsÚwarnÚFutureWarning)r"  r÷   r`   r  r#  s   `    r   Úignorer*    s§   ø€ ôH �„~ð ˆä#4×#;Ñ#;ˆÔ Øˆ	ä�dœDÔ!ÜØQÐRVÐQWÐXó
ð 	
ð
 —Z‘ZÐ 0°$Ó7€NÙÜ�‰ð@àÜ"õ		
ð ‰Ù	Ü�‰ð@àÜ"õ		
ôð Ðr    c                 ó0   — t         j                  | _        | S r   )r  r  r
  r  s    r   Ú_dropr,  Œ  s   € Ü0×6Ñ6€BÔØ€Ir    c                 ó0   — t         j                  | _        | S r   )r  r  r
  r  s    r   Ú_copy_to_script_wrapperr.  ‘  s   € Ü0×GÑG€BÔØ€Ir    c                 ó¨   — t        | «      D ]D  }t        | |«      sŒt        | |«      }t        |«      sŒ(t	        |«      t
        j                  u sŒD y y)NTF)rŽ   r/   rL   r$  Úget_torchscript_modifierr  r  )ÚmodrO   Úitems      r   Úmodule_has_exportsr3  –  sI   € Ü�C–ˆÜ�3˜ÕÜ˜3 Ó%ˆDÜ˜�~Ü+¨DÓ1Ô5F×5MÑ5MÒMÙð ð r    c                 ój   — t        | «      }|€y|t        j                  u xs |t        j                  u S ©NF)r0  r  r  r  )r`   rË   s     r   Úshould_dropr6  £  s7   € Ü# BÓ'€DØ€|ØØÔ$×+Ñ+Ð+ÒN¨tÔ7H×7NÑ7NÐ/NÐNr    c                 óŒ   — t        | «      }|t        j                  u xs& |t        j                  u xs |t        j                  u S r   )r0  r  r  r  r  ©r`   r1  s     r   r¬   r¬   ª  sH   € Ü
" 2Ó
&€CàÔ ×'Ñ'Ð'ò 	*ØÔ#×*Ñ*Ð*ò	*àÔ#×)Ñ)Ð)ðr    c                 ó<   — t        | «      }|t        j                  u S r   )r0  r  r  r8  s     r   Ú_is_drop_fnr:  ³  s   € Ü
" 2Ó
&€CØÔ#×)Ñ)Ð)Ð)r    c                 óN   — t        t        j                  | |d ¬«      t        «      S )N)rú   )r0   r“   Úgetattr_staticÚstaticmethod©r´   r`   s     r   Úis_static_fnr?  ¸  s   € Ü”g×,Ñ,¨S°"¸dÔCÄ\ÓRÐRr    c                 óB   — t        j                  | |«      j                  S r   )r“   r<  Ú__func__r>  s     r   Úget_static_fnrB  ¼  s   € Ü×!Ñ! # rÓ*×3Ñ3Ð3r    c                 ó€   — t        | «      sy t        | d«      r| j                  } t        | dt        j
                  «      S )NrA  r
  )r$  r/   rA  rL   r  r  r  s    r   r0  r0  À  s6   € Ü�BŒ<ØÜˆr�:ÔØ�[‰[ˆÜ�2Ð.Ô0A×0IÑ0IÓJÐJr    c                 ó.   — t        | «      }|€y ||_        y r   )r0  r
  )ÚorigÚnewrË   s      r   Úcopy_torchscript_modifierrG  È  s   € Ü# DÓ)€DØ€|ØØ $€CÕr    Ú_overloaded_fnsaP  
Example usage of overload function:
@torch.jit._overload
def my_function(x: type0) -> type0: # decl 1
    pass

@torch.jit._overload
def my_function(x: type1) -> type1: # decl 2
    pass

def my_function(x):                 # implementation
    if isinstance(x, type0):
        return x
    elif isinstance(x, type1):
        return x
c           	      óˆ   — t        |«      \  }}}d| › dt        |«      › d|› d|› d�	dj                  |«      z   dz   t        z   S )NzImplementation for the z "zk" is missing. Please make sure a definition is provided and defined after all overload declarations.
File "z", line z:
Ú Ú
)r   rW   rÉ   Ú_OVERLOAD_EXAMPLE)r¾   rT   ÚsourcelinesÚfile_linenoÚfilenames        r   Ú,get_overload_no_implementation_error_messagerP  é  sj   € Ü)BÀ3Ó)GÑ&€K�˜hà
! $  r¬/¸#Ó*>Ð)?ð @à�
˜( ; -¨sð	4ð �'‰'�+Ó
ñ	ð ñ		ô
 ñ	ðr    c                 óž  — 	 t        | «      }|j                  j
                  d   j
                  }d„ }d„ }t        |«      dk7  s ||d   «      sU ||d   «      sId	}|d
j                  |j                  j                  d
«      d d «      z  }|dt        z   z  }t        |«      ‚y y # t        $ r t        j                  d| › d�d¬«       Y y w xY w)Nz=Unable to retrieve source for @torch.jit._overload function: rG   r:   ©r  r   c                 ó6   — t        | t        j                  «      S r   )r0   rÅ   ÚPass©Úxs    r   Úis_passz%_check_overload_body.<locals>.is_pass  s   € Ü˜!œSŸX™XÓ&Ð&r    c                 ó¾   — t        | t        j                  «      xrB t        | j                  t        j                  «      xr | j                  j                  t
        u S r   )r0   rÅ   ÚExprr‚   rÏ   ÚEllipsisrU  s    r   Úis_ellipsisz)_check_overload_body.<locals>.is_ellipsis  sA   € ä�qœ#Ÿ(™(Ó#ò *Ü˜1Ÿ7™7¤C§L¡LÓ1ò*à—‘—‘¤Ð)ð	
r    rj   zHOnly `pass` statement or `...` can be the body of overload declaration:
rK  é   z$ <- Expecting `pass` or `...` here!
)r   rÖ   r'  r(  rÅ   rÜ   rv   rÉ   ra   rl   rL  rP   )ÚfuncÚ
parsed_defrÜ   rW  r[  Úmsgs         r   Ú_check_overload_bodyr`  õ  sç   € ð	Ü˜t“_ˆ
ð �>‰>×Ñ˜qÑ!×&Ñ&€Dò'ò
ô ˆ4ƒy�A‚~™g d¨1¡gÔ.±+¸dÀ1¹gÔ2FàWð 	ð 	ˆt�y‰y˜×*Ñ*×0Ñ0°Ó6°r¸Ð:Ó;Ñ;ˆØÐ6Ô9JÑJÑJˆÜ˜3ÓÐð 3GÐ.øô+ ò ô 	�‰ØKÈDÈ6ÐQRÐSØõ	
ñ 	ðús   ‚B% Â%$CÃCc                 ó˜   — t        | «       t        | «      }t        j                  |«      }|€g }|t        |<   |j	                  | «       | S r   )r`  rW   rH  rd   ry   )r]  Ú	qual_nameÚfn_overload_lists      r   Ú	_overloadrd    sN   € Ü˜ÔÜ Ó%€Iä&×*Ñ*¨9Ó5ÐØÐØÐØ%5Œ˜	Ñ"Ø×Ñ˜DÔ!Ø€Kr    c                 ó,   — t         j                  | «      S r   )rH  rd   ©rb  s    r   Ú_get_fn_overloadsrg  "  s   € Ü×Ñ˜yÓ)Ð)r    c                 ó   — t         | = y r   )rH  rf  s    r   Ú_clear_fn_overloadsri  &  s
   € Ü˜	Ñ"r    c                 óü   — t        j                  «       }t        d«      D ]  }|€t        d|› �«      ‚|j                  }Œ  |€t        d«      ‚|j
                  j                  }|j
                  j                  }||fS )Nr:   z#current_frame is None at iteration z-current_frame is None after traversing frames)r“   r”   Úrangerx   r•   Úf_codeÚco_nameÚco_firstlineno)ÚmethodÚcurrent_framer{   Ú
class_nameÚline_nos        r   Úget_class_name_linenors  *  s…   € Ü×(Ñ(Ó*€Mô �1ŽXˆØÐ Ü Ð#FÀqÀcÐ!JÓKÐKØ%×,Ñ,‰ð ð
 ÐÜÐLÓMÐMØ×%Ñ%×-Ñ-€JØ×"Ñ"×1Ñ1€GØ�wÐÐr    Ú_overloaded_methodsÚ_overloaded_method_class_filenoc                 ó6  — t        | «       t        | «      }t        j                  |«      }|€i }|t        |<   t	        | «      \  }}|j                  |«      }|€g }|||<   |t
        ||f<   nt
        ||f   }||k7  rt        d«      ‚|j                  | «       | S )NzmCannot currently overload the same method name in two different classes with the same name in the same module)r`  rW   rt  rd   rs  ru  rP   ry   )r]  rb  Úclass_name_maprq  rr  Úmethod_overloadsÚexisting_linenos          r   Ú_overload_methodrz  K  s¿   € Ü˜ÔÜ Ó%€Iä(×,Ñ,¨YÓ7€NØÐØˆØ)7Ô˜IÑ&ä/°Ó5Ñ€J�Ø%×)Ñ)¨*Ó5ÐØÐØÐØ%5ˆ�zÑ"ØCJÔ'¨°JÐ(?Ò@ä9¸9ÀjÐ:QÑRˆØ˜gÒ%ÜðAóð ð
 ×Ñ˜DÔ!Ø€Kr    c                 óR  — t        | d«      sy t        | «      }t        j                  |«      }|€y |j                  |j                  d «      }|€y t        | «      d   }t        |«      d   }|t        t        |«      d   «      z   }||k\  r||k  st        dt        | «      z   «      ‚|S )Nr"   rj   r   zKOverloads are not usable when a module is redeclared within the same file: )	r/   rW   rt  rd   r"   r   rv   rx   r%   )ro  Ú	mod_classrb  rw  Ú	overloadsÚmethod_line_noÚmod_class_filenoÚmod_end_filenos           r   Ú_get_overloaded_methodsr�  f  sÁ   € ä�6˜:Ô&ØÜ Ó'€IÜ(×,Ñ,¨YÓ7€NØÐØØ×"Ñ" 9×#5Ñ#5°tÓ<€IØÐØä.¨vÓ6°qÑ9€NÜ0°Ó;¸AÑ>ÐØ%¬Ô,EÀiÓ,PÐQRÑ,SÓ(TÑT€NØÐ.Ò.°>À^Ò3SÜØYÜ�&‹kñó
ð 	
ð Ðr    c                 óœ   — | t         j                  u rt        d«       t        | d«      syt	        | «      }| j
                  dv xr |t        u S )Nr   r#   F©r�   r-   )r-   r   Ú'raise_error_container_parameter_missingr/   r	   r#   rz   ©r3   Ú
ann_origins     r   Úis_tupler‡  }  sH   € à
Œf�l‰lÑÜ/°Ô8ô �3˜Ô%Øä˜C“€JØ�>‰>Ð3Ð3ÒK¸
ÄeÐ8KÐKr    c                 óœ   — | t         j                  u rt        d«       t        | d«      syt	        | «      }| j
                  dv xr |t        u S )Nr
   r#   Frƒ  )r-   r
   r„  r/   r	   r#   r¯   r…  s     r   Úis_listr‰  Š  óF   € à
Œf�k‰kÑÜ/°Ô7ä�3˜Ô%Øä˜C“€JØ�>‰>Ð3Ð3ÒJ¸
ÄdÐ8JÐJr    c                 óœ   — | t         j                  u rt        d«       t        | d«      syt	        | «      }| j
                  dv xr |t        u S )Nr   r#   Frƒ  )r-   r   r„  r/   r	   r#   Údictr…  s     r   Úis_dictr�  –  rŠ  r    c                 ó¬   — | t         u rt        d«       t        | t        «      xs0 t	        | d«      xr" | j
                  dk(  xr t        | «      t         u S )Nr   r#   r-   )r   r„  r0   r(   r/   r#   r	   r2   s    r   Úis_unionr�  ¢  sR   € Ø
Œe�|Ü/°Ô8ä�cÔ+Ó,ò Ü��\Ó"ò 	'Ø�N‰N˜hÑ&ò	'ä˜‹_¤Ð%ðr    c                 ór   — | t         u rt        d«       d„ }d„ } || «      xs t        | «      xr  || «      S )Nr   c                 ób   — t        | d«      xr" | j                  dk(  xr t        | «      t        u S )Nr#   r-   )r/   r#   r	   r   r2   s    r   Úis_optional_as_optionalz,is_optional.<locals>.is_optional_as_optional±  s3   € ä�C˜Ó&ò .Ø—‘ (Ñ*ò.ä˜C“¤HÐ,ð	
r    c                 ó^   — t        | «      }t        |«      dk(  xr d |v xs t        d «      |v S )Nr:   )r   rv   r1   )r3   Úann_argss     r   Úis_union_as_optionalz)is_optional.<locals>.is_union_as_optional¸  s2   € Ü˜C“=ˆÜ�8‹} Ñ!ÒR t¨xÐ'7Ò'Q¼4À»:ÈÐ;QÐRr    )r   r„  r�  )r3   r’  r•  s      r   Úis_optionalr–  ­  s>   € Ø
Œh�Ü/°
Ô;ò
òSñ # 3Ó'ÒX¬H°S«MÒ,WÑ>RÐSVÓ>WÐXr    c                 óJ   — | t         u rt        d«      ‚t        | «      t         u S )Nz_Attempted to use Future without a contained type. Please add a contained type, e.g. Future[int])r   rP   r	   r2   s    r   Ú	is_futurer˜  ¿  s,   € Ø
Œf�}Üðó
ð 	
ô
 �c‹?œfÐ$Ð$r    c                 ó6   — | t         u ryt        | «      t         u S )NT)r   r	   r2   s    r   Úis_awaitrš  É  s   € Ø
Œf�}ØÜ�c‹?œfÐ$Ð$r    )ÚPyRRef)ÚRRefc                 óJ   — | t         u rt        d«      ‚t        | «      t         u S )Nz[Attempted to use RRef without a contained type. Please add a contained type, e.g. RRef[int])rœ  rP   r	   r2   s    r   Úis_rrefrž  Ó  s,   € Ø”$‰;Üðóð ô
 ˜#‹¤$Ð&Ð&r    c                 ó"   — t        | t        «      S r   )r0   r›  ©rT   s    r   Úis_rref_instancer¡  Ü  s   € Ü˜#œvÓ&Ð&r    c                  ó   — yr5  r   r   s    r   r¡  r¡  á  s   € àr    c                 óD   — t        | «      sy t        j                  | «      S r   )r$  r*   rd   r  s    r   Ú_try_get_dispatched_fnr¤  æ  s   € Ü�BŒ<ØÜ×!Ñ! "Ó%Ð%r    Úlocc           
      ó¨  — |€
t        «       }t        | t        «      rt        | d«      st	        d| › �«      ‚t        | d«      r5| j
                  D �cg c]  }|| j                  v r| j                  |   ‘Œ! }}ng }t        j                  | «      }t        |«      dk(  r+t        | d«      rt        j                  | j                  «      }g }| j
                  D ]Ó  }||v r–||   }t        |t        «      rD|�B ||j                  «      }|€,t        d|› d| j                  › d|j!                  «       › �«      ‚|}t"        j$                  j&                  j)                  |||«      }	|j+                  |	«       Œ�|j+                  t"        j,                  j.                  j1                  «       «       ŒÕ t3        | «      j                  | j
                  ||fS c c}w )	NÚ_fieldsz7expected namedtuple (tuple subclass with _fields), got Ú_field_defaultsr   Ú__base__zUnknown type annotation: 'z' in NamedTuple zh. Likely due to partial support for ForwardRef parameters in NamedTuples, see #95858. Issue occurred at )r   r°   rz   r/   rx   r§  r¨  r“   Úget_annotationsrv   r©  r0   r   Ú__forward_arg__Ú
ValueErrorr"   Ú	highlightrH   ÚjitÚannotationsÚann_to_typery   rI   Ú
TensorTypeÚgetInferredr1   )
rT   r¥  ÚrcbÚfieldÚdefaultsÚobj_annotationsr¯  Ú
field_typeÚrcb_typeÚthe_types
             r   Ú_get_named_tuple_propertiesrº  ì  sÎ  € ð
 €{Ü‹lˆä�cœ5Ô!¬°°iÔ)@ÜØEÀcÀUÐKó
ð 	
ô ˆsÐ%Ô&ð Ÿšó
á$�Ø˜×+Ñ+Ñ+ð ×Ñ Ó&Ø$ð 	ñ 
ð ˆä×-Ñ-¨cÓ2€OÜ
ˆ?Ó˜qÒ ¤W¨S°*Ô%=Ü!×1Ñ1à�L‰Ló
ˆð
 €KØ—”ˆØ�OÑ#Ø(¨Ñ/ˆJôH ˜*¤jÔ1°c°oÙ˜z×9Ñ9Ó:�àÐ#Ü$Ø4°Z°LÐ@PÐQT×Q]ÑQ]ÐP^ð _.à.1¯m©m«oÐ->ð@óð ð
 &�
Ü—y‘y×,Ñ,×8Ñ8¸ÀSÈ#ÓNˆHØ×Ñ˜xÕ(à×ÑœuŸx™x×2Ñ2×>Ñ>Ó@ÕAðg ôh �‹9×Ñ˜sŸ{™{¨K¸ÐAÐAùòI
s   Á$GÚunqual_nameÚfield_namesrµ  c                 ó<   — t        j                  |||¬«      } || Ž S )N)rµ  )ÚcollectionsÚ
namedtuple)Útr»  r¼  rµ  Ú	TupleTypes        r   Ú_create_named_tuplerÂ  @  s"   € ô ×&Ñ& {°KÈ(ÔS€IÙ�aˆ=Ðr    c               #   ó4  K  — t         j                  j                  «       } t         j                  j                  d d «       	 d –— t         j                  j                  | d   | d   «       y # t         j                  j                  | d   | d   «       w xY w­w©Nr   rj   )rH   rI   Ú_jit_get_emit_hooksÚ_jit_set_emit_hooks)Úhookss    r   Ú_disable_emit_hooksrÈ  J  sl   è ø€ ä�H‰H×(Ñ(Ó*€EÜ	‡H�H× Ñ   tÔ,ð9Ûä�‰×$Ñ$ U¨1¡X¨u°Q©xÕ8øŒ�‰×$Ñ$ U¨1¡X¨u°Q©xÕ8üs   ‚?BÁA- Á'BÁ-(BÂBc                 ó   — dd„}dd„}y )Nc                 óŠ   — t         j                  j                  «       | _        t         j                  j	                  d d «       y r   )rH   rI   rÅ  rÇ  rÆ  r]   s    r   Ú	__enter__z0_disable_emit_hooks_decorator.<locals>.__enter__V  s*   € Ü—X‘X×1Ñ1Ó3ˆŒ
Ü�‰×$Ñ$ T¨4Õ0r    c                 óx   — t         j                  j                  | j                  d   | j                  d   «       y rÄ  )rH   rI   rÆ  rÇ  )r   rÞ   s     r   r  z/_disable_emit_hooks_decorator.<locals>.__exit__Z  s&   € Ü�‰×$Ñ$ T§Z¡Z°¡]°D·J±J¸q±MÕBr    ©r   Nr   )Ú_DecoratorContextManagerrË  r  s      r   Ú_disable_emit_hooks_decoratorrÏ  T  s   € ó1ôCr    c                 óN   — t        j                  | «      syt        | t        «      S r5  )r“   Úisclassr°   r�   r   s    r   Ú_is_exceptionrÒ  ^  s   € Ü�?‰?˜3ÔØÜ�cœ9Ó%Ð%r    c                 ól   — | j                  d«      rt        d| › d| › d�«      ‚t        d| › d| › d�«      ‚)NÚictzAttempted to use z: without contained types. Please add contained type, e.g. z
[int, int]z= without a contained type. Please add a contained type, e.g. z[int])ÚendswithrP   )Útarget_types    r   r„  r„  d  s]   € Ø×Ñ˜EÔ"ÜØ ˜}ð -@àˆm˜:ð'ó
ð 	
ô
 Ø
˜K˜=ð )=àˆ-�uð	óð r    rŒ  r¯   rz   r   r
   r   r   c                 óJ   — t         j                  | «      x}rt        |«       y y r   )Ú_RAW_TYPE_NAME_MAPPINGrd   r„  )rÖ  rO   s     r   Úcheck_args_existrÙ  }  s%   € Ü%×)Ñ)¨+Ó6Ð6€tÐ6Ü/°Õ5ð 7r    c                 óR   — | g k(  s
| i k(  s| dk(  rt        j                  dd¬«       y y )Nr   z¿The inner type of a container is lost when calling torch.jit.isinstance in eager mode. For example, List[int] would become list and therefore falsely return True for List[float] or List[str].r:   rR  )r'  r(  r   s    r   Úcheck_empty_containersrÛ  ‚  s0   € Ø
ˆb‚y�C˜2’I ¨¢Ü�‰ðð
 ö	
ð "+r    c                 óD  — t        |«      }t        |«       |€y|t        u s|t        j                  u r\t        | «       t        | t        «      syt        |«      d   }t        |«      }| D ]!  }|rt        ||«      rŒ yt        ||«      rŒ! y y|t        j                  u s|t        u r‰t        | «       t        | t        «      syt        |«      d   }t        |«      d   }| j                  «       D ]=  \  }}	t        ||«      s yt        |«      }
|
rt        |	|«      rŒ. yt        |	|«      rŒ= y y|t        j                  u s|t        u r~t        | «       t        | t        «      syt        |«      }t        | «      t        |«      k7  ryt        | |«      D ]/  \  }}t        |«      }|rt        ||«      rŒ  yt        ||«      rŒ/ y y|t         u st#        |t$        «      r>| €yt        |«      }|D ]+  }t        |«      }|rt        | |«      c S t        | |«      sŒ+ y y)NFr   Trj   )r	   rÙ  r¯   r-   r
   rÛ  r0   r   Úcontainer_checkerr   rŒ  r½   r   rz   rv   Úzipr   r°   r(   )rT   rÖ  Úorigin_typeÚarg_typeÚ
arg_originÚelÚkey_typeÚval_typer   ÚvalÚ
val_originÚ	arg_typesÚel_typeÚ	el_originÚinner_typesrÀ  Út_origins                    r   rÝ  rÝ  �  s  € Ü˜[Ó)€KÜ�[Ô!ØÐØØ	œÑ	 ¬v¯{©{Ñ :Ü˜sÔ#Ü˜#œtÔ$ØÜ˜KÓ(¨Ñ+ˆÜ Ó)ˆ
ÛˆBáÜ(¨¨XÕ6Ù Ü  HÕ-Ùð ð Ø	œŸ™Ñ	# {´dÑ':Ü˜sÔ#Ü˜#œtÔ$ØÜ˜KÓ(¨Ñ+ˆÜ˜KÓ(¨Ñ+ˆØŸ	™	ž‰HˆC�ä˜c 8Ô,ÙÜ# HÓ-ˆJÙÜ(¨¨hÕ7Ù Ü  XÕ.Ùð $ð Ø	œŸ™Ñ	$¨´uÑ(<Ü˜sÔ#Ü˜#œuÔ%ØÜ˜[Ó)ˆ	Üˆs‹8”s˜9“~Ò%ØÜ˜s IÖ.‰KˆB�Ü" 7Ó+ˆIÙÜ(¨¨WÕ5Ù Ü  GÕ,Ùð /ð Ø	œÑ	¤ØÜô"ð ˆ;ØÜ˜{Ó+ˆÛˆAÜ! !“}ˆHÙÜ(¨¨aÓ0Ò0Ü˜C Õ#Ùð ð r    c                 ó  — t        |t        j                  j                  «      r1t        |t        «      st        d«      ‚|D ]  }t        | |«      sŒ y yt        |«      }|rt        | |«      S t        |«       t        | |«      S )NzPThe second argument to `torch.jit.isinstance` must be a type or a tuple of typesTF)
r0   r¾  ÚabcÚ	Containerrz   rP   Ú_isinstancer	   rÝ  rÙ  )rT   rÖ  Út_typerß  s       r   rï  rï  Ó  sƒ   € Ü�+œ{Ÿ™×8Ñ8Ô9Ü˜+¤uÔ-Üð&óð ó
 "ˆFÜ˜3 Õ'Ùð "ð ä˜[Ó)€KÙÜ   kÓ2Ð2ô �[Ô!ô �c˜;Ó'Ð'r    c                   óD   ‡ — e Zd Zdeej
                     fˆ fd„Zd„ Zˆ xZS )Ú_TensorExtractorÚtensorsc                ó2   •— t        ‰| �  |i |¤Ž || _        y r   )Úsuperr^   ró  )r   ró  rÞ   r÷   Ú	__class__s       €r   r^   z_TensorExtractor.__init__í  s   ø€ Ü‰Ñ˜$Ð) &Ò)Øˆ�r    c                 ól  — t        |t        j                  «      r| j                  j	                  |«       yt        |t
        «      ryt        |t        «      st        |«      ryt        |t        «      ryt        |t        j                  j                  «      ryt        |t        j                  «      ryy )NrJ  )r0   rH   ÚTensorró  ry   r)   ÚCFuturer¡  ÚCAwaitÚcudaÚEventÚ	threadingÚThread)r   rT   s     r   Úpersistent_idz_TensorExtractor.persistent_idñ  s…   € Ü�cœ5Ÿ<™<Ô(Ø�L‰L×Ñ Ô$Øô �cœ8Ô$Øô �cœ7Ô#Ô'7¸Ô'<ØÜ�cœ6Ô"ØÜ�cœ5Ÿ:™:×+Ñ+Ô,ØÜ�cœ9×+Ñ+Ô,ØØr    )	r"   r#   r$   r¯   rH   rø  r^   rÿ  Ú__classcell__)rö  s   @r   rò  rò  ì  s   ø„ ð t¨E¯L©LÑ'9õ ör    rò  c                 ól   — g }t        t        j                  «       d|¬«      }|j                  | «       |S )z¸
    This function is exclusively called from C++.
    See ``torch/csrc/jit/python/python_ivalue.h``.

    It extracts the tensors contained in the given object, through pickling.
    éÿÿÿÿ)Úprotocolró  )rò  ÚioÚBytesIOÚdump)rT   ró  Ú	extractors      r   Ú_extract_tensorsr  
  s.   € ð #%€GÜ ¤§¡£¸ÀGÔL€IØ‡N�N�3ÔØ€Nr    c                 óò   — t        | t        j                  j                  «      r#t	        | j
                  j                  «       «      S t        | t        j                  j                  «      r| j                  S y r   )	r0   rH   r®  ÚScriptModuler%   Ú_cÚ_typerJ   rK   r   s    r   Ú_get_model_idr    sN   € Ü�#”u—y‘y×-Ñ-Ô.Ü�3—6‘6—<‘<“>Ó"Ð"Ü	�CœŸ™×1Ñ1Ô	2Ø×!Ñ!Ð!àr    )r\  é   )T)r   )FrÍ  )NN)�rý   rÅ   r�   r¾  Ú
contextlibrM   r“   r  ÚpickleÚsysrÚ   rý  r8   r-   r'  Úweakrefr   r   r   r   r   r   r	   r
   r   r   r   r   r   r.   r   rH   Útorch.distributed.rpcÚtorch.package._manglingÚpackageÚ	_manglingrQ   Útorch._awaitsr   Útorch._Crú  r   rù  Útorch._sourcesr   r   r   Útorch.futuresr   r&   r'   Ú	UnionTyper(   r1   rz   Ú__annotations__Ú_threadr)   ÚImportErrorÚ_dummy_threadÚWeakKeyDictionaryr*   ÚFAKE_FILENAME_PREFIXr%  r4   r6   ÚBroadcastingList1rk  r{   Úglobalsr>   r%   rW   rY   rÔ   rˆ   r‡   r—   r£   rª   r¹   r¯   rÃ   rÊ   rî   rô   r   r  r  r  ÚAbstractContextManagerr  r*  r,  r.  r3  r6  r¬   r:  r?  rB  r0  rG  rH  rŒ  rL  rP  r`  rd  rg  ri  rs  rt  ru  rz  r�  r‡  r‰  r�  r�  r–  r˜  rš  ÚdistributedÚrpcÚis_availableÚtorch._C._distributed_rpcr›  rœ  rž  r¡  r¤  rI   Ú_jit_tree_viewsÚSourceRangerº  rÂ  ÚcontextmanagerrÈ  rÏ  rÒ  r„  rØ  rÙ  rÛ  rÝ  rï  ÚPicklerrò  r  r  Úversion_inforN   Ú__new__Ú
__format__Ú__repr__Ú__str__r   r    r   Ú<module>r2     sÒ  ðòó Û Û Û Û Û Û 	Û Û 
Û Û Û Û Û Û ÷÷ ÷ õ õ (ã ó
 ß 2Ð 2Ý  ß 8ß KÑ KÝ  ô0�ô 0ñ ˆtƒ_€ÙˆTƒ]€à,1¯O©OÐ �$˜˜t S˜yÑ)Ñ)Ó ;à
ƒð&Ûà×Ñ€Hð €G×ÑÓð ÐNó ð
 /Ð ð�Tó ÷ñ ñ (Ó)Ð Ù	ˆq�!Ž€AØ(9�GƒIÐ   Ð$Ò%ð 
ð�dó ñ.C$¨có C$÷L$ñ $ñ 
‹€ðA5°ð A5ÀÈ#ÈÐPSÈÑ@Tó A5ñH32°ð 32¸XÀsÀeÈSÀjÑ=Qó 32òl
ðt=¨x¸¸¸s¸
Ñ/Có =ð,˜dó ð* t¨C¡yó ò>ò,Tðn#°ð #¸(ÀCÀ5È#À:Ñ:Nó #òL4÷nQñ Qð .ˆx˜˜B˜Ñð . H¨R°¨VÑ$4ó .ðb6ˆx˜˜B˜Ñð 6 H¨R°¨VÑ$4ó 6ôt˜J×=Ñ=ô ólð^ˆh�r˜2�vÑð  8¨B°¨FÑ#3ó ð
 ¨¨R¨Ñ 0ð °X¸bÀ"¸fÑ5Eó ò
ðO�tó Oð˜ó ð*�tó *ð
S˜Tó Sò4òKó%ð .0€��c˜4 ™>Ð)Ñ*Ó /ðÐ ò$	ò òB	ò*ó#ð U¨3°¨8¡_ó ð4 =?Ð �T˜#˜t C¨¨h©Ð$7Ñ8Ð8Ñ9Ó >ð ?AÐ   e¨C°¨H¡o°sÐ&:Ñ!;Ó @òò6ð.
L�Tó 
Lð	K�Dó 	Kð	K�Dó 	KòòYð$%�dó %ð%�Tó %ð 	×Ñ×Ñ×%Ñ%Ô'Ý0Ý*ð'˜ó 'ð' ô 'ð
 ó ò
&ð 8<ØñQBà	�Š×	!Ò	!×	-Ò	-°Ñ	4óQBðhàðð �c‘ðð �C˜�H‰oó	ð ×Òñ9ó ð9óCð&˜$ó &óð 	ˆ&Øˆ&Ø	ˆ7Ø
‡K�K�Ø
‡K�K�Ø
‡O�O�ZØ
‡L�L�'ðÐ ó6ó
	
ð@¨4ó @ðF( Tó (ô2�v—~’~ô ò<
ð˜# ™*ó ð ×Ò�wÒÙ	ˆ$�)Š)×
Ò
ÔÙ	ˆ$�)Š)×
Ò
ÔÙ	ˆ$�)Š)×
Ò
ÔÙ	ˆ$�)Š)×
Ò
Õð	 øðA/ ò &Ûà×%Ñ%ƒHð&ús   ÃQ  Ñ QÑQ