ó
    Eñi±Ô  ã                   ó	  • % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKrSSKrSSKJrJrJrJrJrJrJrJrJrJrJrJrJr  SSKJr  SSKrSSK rSSK!J"s  J#r$  SSK%J&r&  SSK'J&r(J)r*  SSK+J,r,J-r-J.r.  SSK/J)r)   " S	 S
\5      r0\" S5      r1\" S5      r2\Rf                  r4\5\6\5S4   -  \7S'   \5\7S'    SSK8r8\8Rr                  r9\Rx                  " 5       r=S\7S'   Sr>S\?4S jr@ " S S5      rA\A" 5       rB\C" SS5       H  rD\B\E" 5       S\D 3'   M     S\?4S jrFSpS\G4S jjrH " S S5      rI\I" 5       rJS\0S\\G/\4   4S jrKSqS \LS\\G/\4   4S! jjrMS" rNS\\G/\4   4S# jrOS\?4S$ jrPS\Q\G   4S% jrRS& rSS' rTS(\5S\\G/\4   4S) jrUS* rV " S+ S,5      rWS-\\1\24   S\\1\24   4S. jrXS-\\1\24   S\\1\24   4S/ jrY " S0 S1\R´                  5      r[SrS2 jr\S-\\1\24   S\\1\24   4S3 jr]S-\\1\24   S\\1\24   4S4 jr^S5 r_S\?4S6 jr`S\?4S7 jraS\?4S8 jrbS\?4S9 jrcS: rdS; reSsS< jrf0 qg\h\G\Q\   4   \7S='   S>riS? rjS@ rkSA rlSB rmSsSC jrnS\6\G\L4   4SD jro0 qp\h\G\h\G\Q\   4   4   \7SE'   0 rq\h\6\G\G4   \L4   \7SF'   SG rrSH rsS\?4SI jrtS\?4SJ jruS\?4SK jrvSL rwSM rxS\?4SN jryS\?4SO jrz\Rö                  Rø                  Rû                  5       (       a  SSPK~Jr  SSQK J€r€  S\?4SR jr�S\?4SS jr‚OS\?4ST jr‚SU rƒ  StSV\GR                  GR
                  GR                  S-  4SW jjr‡SX\GSY\Q\G   SZ\6\S4   4S[ jrˆ\GR                  S\ 5       rŠSsS] jr‹S\?4S^ jrŒSsS_ jr�\hS`\QSa\6Sb\R$                  Sc\R.                  Sd\R0                  Se\R4                  Sf0rŽSsSg jr�SsSh jr�S\?4Si jr‘S\?4Sj jr’ " Sk Sl\GR&                  5      r”Sm r•S\GS-  4Sn jr–\	GR.                  So:¼  ay  \]" \GR0                  GR2                  5        \]" \GR0                  GR4                  5        \]" \GR0                  GR6                  5        \]" \GR0                  GR8                  5        gg! \: a    SSK;r;\;Rr                  r9 GN®f = f)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                   ó&   • \ rS rSrS\S\4S jrSrg)Ú
HasGetattré5   ÚkeyÚreturnc                 ó   • g ©N© )Úselfr   s     ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/_jit_internal.pyÚ__getattr__ÚHasGetattr.__getattr__6   s   € ¨Có    r   N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ústrr   r    Ú__static_attributes__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                 ó¶   • [        U S5      =(       aG    U R                  S;   =(       a1    [        U 5      [        L =(       d    [	        U [        [        5      5      $ )Nr%   >   ÚtypingÚtyping_extensions)Úhasattrr%   r	   r   Ú
isinstanceÚtype©Úanns    r   Úis_finalr8   R   sF   € ä��\Ó"÷ 	GØ�N‰NÐ=Ñ=÷	Gä˜‹_¤Ð%×E¬°C¼¼e»Ó)Eðr"   c                   ó   • \ rS rSrS rSrg)ÚBroadcastingListClsé[   c                 ó   • g r   r   )r   Útypess     r   Ú__getitem__ÚBroadcastingListCls.__getitem__\   s   € Ør"   r   N)r$   r%   r&   r'   r>   r)   r   r"   r   r:   r:   [   s   † õr"   r:   é   é   ÚBroadcastingListc                  ó   • g)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_scriptingrD   g   s   € ð& r"   c                 óª  • [        U S5      (       a  U R                  $ [        U [        R                  R
                  5      (       a  U R                  $ [        U SS 5      (       a  U R                  nO7[        U [        R                  5      (       a  U R                  nO[        S5      eUS:X  a  SnU R                  nUS:X  a  U R                  $ Uc  [        SU S35      e[        R                  " U5      (       a$  UR!                  S	S
5      nUR!                  SS
5      nU(       a  US:X  a  SnOSU-   nSU;   a  [        SU SU S35      eUS-   U-   $ )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)r3   rF   r4   ÚtorchÚ_CÚScriptFunctionÚqualified_nameÚgetattrr$   ÚenumÚEnumÚnameÚRuntimeErrorr%   Úpackage_manglingÚ
is_mangledÚreplace)ÚobjÚmangle_namerU   Úmodule_names       r   Ú_qualified_namer]   ~   sf  € ô ˆ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                   ó&   • \ rS rSrS rS rS rSrg)ÚSourceLoaderéÄ   c                 ó   • 0 U l         g r   ©Úcontent©r   s    r   Ú__init__ÚSourceLoader.__init__Å   s	   € Øˆ�r"   c                 ó    • X R                   U'   g r   rb   )r   ÚfnÚsources      r   ÚcacheÚSourceLoader.cacheÈ   s   € Ø!�‰�RÒr"   c                 ó8   • U R                   R                  U5      $ r   )rc   Úget)r   rh   s     r   Ú
get_sourceÚSourceLoader.get_sourceË   s   € Ø�|‰|×Ñ Ó#Ð#r"   rb   N)r$   r%   r&   r'   re   rj   rn   r)   r   r"   r   r_   r_   Ä   s   † òò"õ$r"   r_   Úlookup_basec                 óÐ   ^ ^^^• S[         S[        S[        4U4S jjmS[         S[        S[        [        [        4   4UU4S jjmS[         S[        S[        4U4S jjmU U4S j$ )	aG  
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.
rQ   Úmoduler   c                 óp   >• SU ;   a%  U R                  SSS9u  p#[        X5      nT" X45      $ [        X5      $ )NrM   é   )Úmaxsplit)ÚsplitrR   )rQ   rr   ÚbaseÚremaining_piecesÚmodule_valueÚlookupInModules        €r   rz   Ú7createResolutionCallbackFromEnv.<locals>.lookupInModuleÜ   sD   ø€ Ø�.Ó Ø%3×%9Ñ%9¸#ÈÐ%9Ð%JÑ"ˆDÜ" 6Ó0ˆLÙ!Ð"2ÓAÐAä˜6Ó2Ð2r"   Úexprc                 ó*  >• SnU[        U 5      :  a&  X   S;  a  US-  nU[        U 5      :  a
  X   S;  a  M  U S U S:X  a  SU4$ T" U S U R                  5       U5      nUc  [        SU S U  35      eU[        U 5      :X  d  X   S:w  a  X24$ X   S:w  a  [        SU S	X   < 35      e/ nX   S
:w  a3  SnUS-  nT" XS  U5      u  peUR                  U5        X%-  nX   S
:w  a  M3  [        U5      S:”  a  U[	        U5         US-   4$ X4S      US-   4$ )Nr   )Ú,Ú[Ú]rt   z()r   zUnresolvable type r   zexpected '[' at position z, got r€   )ÚlenÚstripÚAssertionErrorÚappendÚtuple)	r|   rr   Úirw   ÚpartsÚpart_lenÚpartrz   ÚparseNestedExprs	          €€r   rŠ   Ú8createResolutionCallbackFromEnv.<locals>.parseNestedExprä   sO  ø€ ØˆØ”#�d“)‹m ¡¨Ó >Ø�‰FˆAð ”#�d“)‹m ¡¨Õ >ð
 ��ˆ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ÁgÁ[Ð!QÓRÐRØˆØ‰g˜‹nØˆHØ�‰FˆAÙ,¨T°"¨X°vÓ>‰NˆDØ�L‰L˜ÔØ‰MˆAð ‰g˜�nô ˆu‹:˜‹>Øœ˜e›Ñ% q¨1¡uÐ,Ð,à˜a™‘> 1 q¡5Ð(Ð(r"   c                 ót   >•  T" X5      u  p#U[        U 5      :w  a  [        S5      eU$ ! [         a      g f = f)Nz;whole expression was not parsed, falling back to c++ parser)r�   rƒ   Ú	Exception)r|   rr   ÚvalueÚ
len_parsedrŠ   s       €r   Ú	parseExprÚ2createResolutionCallbackFromEnv.<locals>.parseExpr  sQ   ø€ ð	Ù /°Ó =ÑˆEØœS ›YÓ&Ü$ØQóð ð ˆLøÜó 	ðñ ð	ús   ƒ%) ©7¶7c                 ó   >• T" U T5      $ r   r   )r|   rp   r�   s    €€r   Ú<lambda>Ú1createResolutionCallbackFromEnv.<locals>.<lambda>  s   ø€ ™	 $¨Ô4r"   )r(   r   r…   Úint)rp   rz   r�   rŠ   s   `@@@r   ÚcreateResolutionCallbackFromEnvr–   Ò   sf   û€ ð3¤sð 3´Cð 3¼C÷ 3ð)œcð )¬3ð )´5¼¼c¸±?÷ )ð )ð<œð ¤Sð ¬S÷ õ" 5Ð4r"   Ú	frames_upc                 ó$  ^^• [         R                  " 5       nSnX S-   :  a,  Uc  [        SU 35      eUR                  nUS-  nX S-   :  a  M,  Uc  [        S5      eUR                  mUR
                  m " UU4S jS5      n[        U" 5       5      $ )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   rt   zframe is None at iteration z(frame is None after traversing frames_upc                   ó0   >• \ rS rSrS\S\4U U4S jjrSrg)Ú.createResolutionCallbackFromFrame.<locals>.envi@  r   r   c                 óx   >• UT;   a  TU   $ UT;   a  TU   $ U[        [        5      ;   a  [        [        U5      $ g r   )ÚdirÚbuiltinsrR   )r   r   Ú	f_globalsÚf_localss     €€r   r    Ú:createResolutionCallbackFromFrame.<locals>.env.__getattr__A  sD   ø€ Ø�h‹Ø ‘}Ð$Ø˜	Ó!Ø  ‘~Ð%ØœœH›Ó%Üœx¨Ó-Ð-ð &r"   r   Nr#   )rž   rŸ   s   €€r   Úenvrš   @  s   ø† ð	. 3ð 	.¨3÷ 	.ó 	.r"   r¡   )ÚinspectÚcurrentframerƒ   Úf_backrŸ   rž   r–   )r—   Úframer†   r¡   rž   rŸ   s       @@r   Ú!createResolutionCallbackFromFramer¦     s–   ù€ ô: × Ò Ó"€EØ	€AØ
˜!‰mÓ
Ø‰=Ü Ð#>¸q¸cÐ!BÓCÐCØ—‘ˆØ	ˆQ‰ˆð	 ˜!‰mÕ
ð �}ÜÐGÓHÐHØ�~‰~€HØ—‘€I÷.õ .ô +©3«5Ó1Ð1r"   c                 óÆ   • 0 nUR                  U R                  5        [        U R                  R                  5       H   u  p#U R
                  U   R                  X'   M"     U$ )z;
Get a dictionary of closed over variables from a function
)ÚupdateÚ__globals__Ú	enumerateÚ__code__Úco_freevarsÚ__closure__Úcell_contents)rh   ÚcapturesÚindexÚcaptured_names       r   Úget_closurer²   L  sT   € ð €HØ‡O�O�B—N‘NÔ#ä )¨"¯+©+×*AÑ*AÖ BÑˆØ"$§.¡.°Ñ"7×"EÑ"EˆÓñ !Cð €Or"   c                 óT   ^• [        U 5      m " U4S jS5      n[        U" 5       5      $ )zs
Create a resolutionCallback by introspecting the function instead of
looking up the stack for the enclosing scope
c                   ó.   >• \ rS rSrS\S\4U 4S jjrSrg)Ú;createResolutionCallbackFromClosure.<locals>.closure_lookupi�  r   r   c                 ó°   >• UT;   a  TU   $ [        [        U5      (       a  [        [        U5      $ [        [        U5      (       a  [        [        U5      $ g r   )r3   r1   rR   r�   )r   r   Úclosures     €r   r    ÚGcreateResolutionCallbackFromClosure.<locals>.closure_lookup.__getattr__�  sK   ø€ Ø�g‹~Ø˜s‘|Ð#Üœ ×%Ñ%Üœv sÓ+Ð+Üœ 3×'Ñ'Üœx¨Ó-Ð-Ør"   r   Nr#   )r·   s   €r   Úclosure_lookuprµ   �  s   ø† ð	 3ð 	¨3÷ 	ò 	r"   r¹   )r²   r–   )rh   r¹   r·   s     @r   Ú#createResolutionCallbackFromClosurerº   †  s(   ø€ ô
 ˜"‹o€G÷
ô 
ô +©>Ó+;Ó<Ð<r"   c           
      ó˜  • [        U 5      (       a  g[        R                  R                  [        [
        [        4n[        X5      (       a  gU R                  nU Vs/ s H5  n[        R                  " [        XS 5      5      (       d  M*  [        X5      PM7     nnU Vs/ s H  n[        US5      PM     nn[        U5      $ s  snf s  snf )NFr«   )Úis_ignored_fnrN   ÚnnÚModuler…   Úlistr�   Ú
issubclassÚ__dict__r¢   Ú	isroutinerR   r3   Úall)ÚclsÚignored_builtin_classesÚnamesrU   Úfnsrh   Úhas_codes          r   Úcan_compile_classrÉ   œ  s±   € ô �S×ÑØô  %Ÿx™xŸ™´´t¼YÐGÐÜ�#×/Ñ/Øà�L‰L€Eñ óâˆDÜ×ÒœW S°Ó5×6ó 	Œ�ÖÙð ð ñ
 36Ó6²#¨B”˜˜JÖ'±#€HÐ6Üˆx‹=Ðùòùò
 7s   Á)CÂ
CÂCc                 óü   •  [         R                  " U 5      n/ nUR                  R	                  5        H2  u  p4UR
                  UR                  :w  a  M!  UR                  U5        M4     U$ ! [         a    / s $ f = f)a1  
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_KEYWORDr„   )rh   Úcallable_signatureÚargument_namesrU   Úparams        r   Úget_callable_argument_namesrÓ   ±  s}   € ðÜ$×.Ò.¨rÓ2Ðð €NØ)×4Ñ4×:Ñ:Ö<‰ˆð �:‰:˜×4Ñ4Ó4Ùà×Ñ˜dÖ#ñ =ð Ðøô ó ØŠ	ðús   ‚A, Á,A;Á:A;c                 ó   • [        U [        R                  5      (       a  U R                  $ [        U [        R                  5      (       a0  SR                  [        U R                  5      U R                  /5      $ [        U [        R                  5      (       a0  U R                  n[        U R                  5       S[        U5       S3$ [        U [        R                  5      (       a5  SR                  U R                   Vs/ s H  n[        U5      PM     sn5      $ [        U [        R                  5      (       a  U R                   $ gs  snf )z{
Convert an AST node containing a type annotation to the string present in the source
that represents the same annotation.
rM   r   r€   r~   N)r4   Ú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   ÄEc                 ó¦  • [         R                  U 5      nUc   [        R                  " U 5      n[        R
                  " U 5      nUR                  R                  5        VVs0 s H[  u  pEUR                  [        R                  R                  Ld  M.  [        UR                  [        5      (       a  MO  XER                  _M]     nnn[        R                  " [        R                   " U5      5      n[#        UR$                  5      S:w  d,  [        UR$                  S   [        R&                  5      (       d  [)        SU  S35      eUR$                  S   n0 n	UR*                  R*                   HI  n
U
R                  (       a  [-        U
R                  5      OSnUc  M0  U
R.                  nXÆ;   d  MC  Xl   X›'   MK     [-        UR0                  5      nUSLnUR2                  nU[        R                  R                  L=(       a    [        U[        5      (       + nU(       a  U(       a  XùU'   U	$ ! [         a  n[	        SU  S35      UeSnAff = fs  snnf )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.getsourcert   r   z	Expected z to be a function)Úloaderrn   r¢   Ú	getsourceÚOSErrorrË   rÌ   rÍ   rà   Ú	ParameterÚemptyr4   r(   rÕ   ÚparseÚtextwrapÚdedentr�   ÚbodyÚFunctionDefrV   ÚargsrÚ   ÚargÚreturnsÚreturn_annotation)rh   ÚsrcÚerË   rU   Ú	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ó 	#ˆ×"Ñ"Ò"Ù;ð ñ ô 	�	Š	”(—/’/ #Ó&Ó'€AÜ
ˆ1�6‰6ƒ{�aÓœz¨!¯&©&°©)´S·_±_×EÑEÜ˜Y r dÐ*;Ð<Ó=Ð=Ø	�‰ˆq‰	€Að
 Ðà�v‰v�{Œ{ˆð 36·.·.Ô˜sŸ~™~Ô.Àdð 	ð Ñ%Ùð
 —7‘7ˆØÕ#Ø5AÑ5KÐÓ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)   šH+ Á#-IÂIÂ5IÈ+
I
È5IÉI
rÄ   c           	      ó   ^• U R                    Vs/ s H4  n[        R                  " [        X5      5      (       d  M)  [        X5      PM6     nnU Vs/ s HG  n[        R                  " U5      (       a  M   [        US5      (       d  M3  UR                  S:w  d  ME  UPMI     nn0 mU H7  nTR                  [        U5      5        TR                  [        U5      5        M9     S[        S[        4U4S jjnU$ s  snf s  snf )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                 ó<   >• U T;   a  TU    $ [        [        U S 5      $ r   )rR   r�   )r   r¯   s    €r   Úlookup_in_classÚ@createResolutionCallbackForClassMethods.<locals>.lookup_in_classZ  s#   ø€ Ø�(‹?Ø˜C‘=Ð äœ8 S¨$Ó/Ð/r"   )rÁ   r¢   rÂ   rR   Ú	isbuiltinr3   r$   r¨   r²   rþ   r(   r   )rÄ   rU   rÇ   rh   r  r¯   s        @r   Ú'createResolutionCallbackForClassMethodsr  =  sï   ø€ ð —L’Lóâ ˆDÜ×ÒœW SÓ/×0ó 	Œ�ÖÙ ð ð ñ óâˆBÜ× Ò  ×$ó 	ô �B˜×&ó 	ð �K‰K˜>Ñ)÷	 	Ùð ð ð €HãˆØ�‰œ B›Ô(Ø�‰Ô.¨rÓ2Ö3ñ ð0œSð 0¤S÷ 0ð Ðùò9ùòs"   �(C6¼C6ÁC;Á4C;ÂC;ÂC;c                 óz  ^ ^^^^• UU UUU4S jnTR                   c!  TR                   b  TR                   nUTl         OVTR                   c!  TR                   b  TR                   nUTl         O(TR                   c  TR                   c  SnO[        S5      eX‡l         Ub  XWl        Ub  Xgl        TTTTT S.[        U'   U$ )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                  óv   >• TnTU;   a  UT   nOT[        U 5      :  a  U T   nU(       a  T" U 0 UD6$ T" U 0 UD6$ r   )r�   )rî   ÚkwargsÚdispatch_flagÚ	arg_indexrú   ÚdefaultÚif_falseÚif_trues      €€€€€r   rh   Ú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__rV   r%   r$   r.   )	rú   r
  r  r  r  r\   Ú	func_namerh   Údocs	   `````    r   Úboolean_dispatchr  c  sÂ   ü€ ÷
-ñ 
-ð ‡�Ñ 8×#3Ñ#3Ñ#?Ø×ÑˆØˆ�Ø	×	Ñ	Ñ	! g§o¡oÑ&AØ�o‰oˆØˆÕØ	×	Ñ	Ñ	! g§o¡oÑ&=à‰äÐCÓDÐDØ„JàÑØ#ŒØÑØŒð ØØØØñÔ�rÑð €Ir"   c                   ó0   • \ rS rSrSrSrSrSrSrSr	Sr
S	rg
)ÚFunctionModifiersiš  zb
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)r   N)r$   r%   r&   r'   r  ÚUNUSEDÚIGNOREÚEXPORTÚDEFAULTÚCOPY_TO_SCRIPT_WRAPPERÚ_DROPr)   r   r"   r   r  r  š  s.   † ñð
 J€FØM€FØF€FØN€GàXð ð QƒEr"   r  rh   c                 ó0   • [         R                  U l        U $ )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©rh   s    r   Úexportr  ª  s   € ôZ  1×7Ñ7€BÔØ€Ir"   c                 ó  • [        U [        5      (       a_  U n[        UR                  S[        R
                  5        UR                  (       a%  [        UR                  S[        R
                  5        U$ [        R
                  U l        U $ )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  )r4   ÚpropertyÚsetattrÚfgetr  r  Úfsetr  )rh   Úprops     r   Úunusedr%  Û  sp   € ôP �"”h×ÑØˆÜØ�I‰IÐ.Ô0A×0HÑ0Hô	
ð �9�9ÜØ—	‘	Ð2Ô4E×4LÑ4Lôð ˆä0×7Ñ7€BÔØ€Ir"   c                   ó4   • \ rS rSrS rS\S\S\SS4S jrS	rg)
Ú_IgnoreContextManageri  c                 ó   • g r   r   )r   r  s     r   re   Ú_IgnoreContextManager.__init__  ó   € Ør"   Úexc_typeÚ	exc_valueÚ	tracebackr   Nc                 ó   • g r   r   )r   r+  r,  r-  s       r   Ú__exit__Ú_IgnoreContextManager.__exit__  r*  r"   r   )r$   r%   r&   r'   re   r   r/  r)   r   r"   r   r'  r'    s(   † òð ð °ð Àð È÷ r"   r'  c                 óZ  ^ • [        T 5      (       a  T n[        R                  Ul        U$ [	        T [
        5      (       d  [        ST  35      eUR                  SS5      nU(       a  [        R                  " SS[        S9  Um O!T (       a  [        R                  " SS[        S9  U 4S jnU$ )	a¹  
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                 ón   >• T(       a  [         R                  U l        U $ [         R                  U l        U $ r   )r  r  r  r  )rh   Údrops    €r   Ú	decoratorÚignore.<locals>.decorator‚  s0   ø€ ÞÜ'8×'?Ñ'?ˆBÔ$ð ˆ	ô (9×'?Ñ'?ˆBÔ$Øˆ	r"   )Úcallabler  r  r  r4   ÚboolrV   ÚpopÚwarningsÚwarnÚFutureWarning)r6  r  rh   r2  r7  s   `    r   Úignorer?    s¬   ø€ ôH �‡~�~ð ˆä#4×#;Ñ#;ˆÔ Øˆ	ä�dœD×!Ñ!ÜØQÐRVÐQWÐXó
ð 	
ð
 —Z‘ZÐ 0°$Ó7€NÞÜ�Šð@àÜ"ò		
ð ‰Þ	Ü�Šð@àÜ"ò		
õð Ðr"   c                 ó0   • [         R                  U l        U $ r   )r  r  r  r  s    r   Ú_droprA  Œ  s   € Ü0×6Ñ6€BÔØ€Ir"   c                 ó0   • [         R                  U l        U $ r   )r  r  r  r  s    r   Ú_copy_to_script_wrapperrC  ‘  s   € Ü0×GÑG€BÔØ€Ir"   c                 óÂ   • [        U 5       HP  n[        X5      (       d  M  [        X5      n[        U5      (       d  M2  [	        U5      [
        R                  L d  MP    g   g)NTF)rœ   r3   rR   r9  Úget_torchscript_modifierr  r  )ÚmodrU   Úitems      r   Úmodule_has_exportsrH  –  sJ   € Ü�C–ˆÜ�3×ÓÜ˜3Ó%ˆDÜ˜�~‹~Ü+¨DÓ1Ô5F×5MÑ5MÔMÙñ ð r"   c                 óv   • [        U 5      nUc  gU[        R                  L =(       d    U[        R                  L $ ©NF)rE  r  r  r  )rh   rÛ   s     r   Úshould_droprK  £  s7   € Ü# BÓ'€DØ�|ØØÔ$×+Ñ+Ð+×N¨tÔ7H×7NÑ7NÐ/NÐNr"   c                 ó    • [        U 5      nU[        R                  L =(       d+    U[        R                  L =(       d    U[        R                  L $ r   )rE  r  r  r  r  ©rh   rF  s     r   r¼   r¼   ª  sH   € Ü
" 2Ó
&€CàÔ ×'Ñ'Ð'÷ 	*ØÔ#×*Ñ*Ð*÷	*àÔ#×)Ñ)Ð)ðr"   c                 ó<   • [        U 5      nU[        R                  L $ r   )rE  r  r  rM  s     r   Ú_is_drop_fnrO  ³  s   € Ü
" 2Ó
&€CØÔ#×)Ñ)Ð)Ð)r"   c                 óH   • [        [        R                  " XS S9[        5      $ )N)r  )r4   r¢   Úgetattr_staticÚstaticmethod©rÄ   rh   s     r   Úis_static_fnrT  ¸  s   € Ü”g×,Ò,¨S¸dÑCÄ\ÓRÐRr"   c                 óB   • [         R                  " X5      R                  $ r   )r¢   rQ  Ú__func__rS  s     r   Úget_static_fnrW  ¼  s   € Ü×!Ò! #Ó*×3Ñ3Ð3r"   c                 ó”   • [        U 5      (       d  g [        U S5      (       a  U R                  n [        U S[        R
                  5      $ )NrV  r  )r9  r3   rV  rR   r  r  r  s    r   rE  rE  À  s;   € Ü�B�<‰<ØÜˆr�:×ÑØ�[‰[ˆÜ�2Ð.Ô0A×0IÑ0IÓJÐJr"   c                 ó.   • [        U 5      nUc  g X!l        g r   )rE  r  )ÚorigÚnewrÛ   s      r   Úcopy_torchscript_modifierr\  È  s   € Ü# DÓ)€DØ�|ØØ $Õ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           	      ó†   • [        U5      u  p#nSU  S[        U5       SU SU S3	SR                  U5      -   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   r]   rÙ   Ú_OVERLOAD_EXAMPLE)rÎ   rZ   ÚsourcelinesÚfile_linenoÚfilenames        r   Ú,get_overload_no_implementation_error_messagere  é  sh   € Ü)BÀ3Ó)GÑ&€K˜hà
! $  r¬/¸#Ó*>Ð)?ð @à�
˜( ; -¨sð	4ð �'‰'�+Ó
ñ	ð ñ		ô
 ñ	ðr"   c                 ó²  •  [        U 5      nUR                  R
                  S   R
                  nS nS n[        U5      S:w  d   U" US   5      (       dZ  U" US   5      (       dI  S	nUS
R                  UR                  R                  S
5      S S 5      -  nUS[        -   -  n[        U5      eg g ! [         a    [        R                  " SU  S3SS9   g f = f)Nz=Unable to retrieve source for @torch.jit._overload function: rM   r@   ©r3  r   c                 ó6   • [        U [        R                  5      $ r   )r4   rÕ   ÚPass©Úxs    r   Úis_passÚ%_check_overload_body.<locals>.is_pass  s   € Ü˜!œSŸX™XÓ&Ð&r"   c                 óÒ   • [        U [        R                  5      =(       aG    [        U R                  [        R                  5      =(       a    U R                  R                  [
        L $ r   )r4   rÕ   ÚExprrŽ   rß   ÚEllipsisrj  s    r   Úis_ellipsisÚ)_check_overload_body.<locals>.is_ellipsis  sA   € ä�qœ#Ÿ(™(Ó#÷ *Ü˜1Ÿ7™7¤C§L¡LÓ1÷*à—‘—‘¤Ð)ð	
r"   rt   zHOnly `pass` statement or `...` can be the body of overload declaration:
r`  é   z$ <- Expecting `pass` or `...` here!
)r   ræ   r<  r=  rÕ   rì   r�   rÙ   ri   rv   ra  rV   )ÚfuncÚ
parsed_defrì   rl  rq  Úmsgs         r   Ú_check_overload_bodyrw  õ  sí   € ð	Ü˜t“_ˆ
ð �>‰>×Ñ˜qÑ!×&Ñ&€Dò'ò
ô ˆ4ƒy�Aƒ~™g d¨1¡g×.Ñ.±+¸dÀ1¹g×2FÑ2FàWð 	ð 	ˆt�y‰y˜×*Ñ*×0Ñ0°Ó6°r¸Ð:Ó;Ñ;ˆØÐ6Ô9JÑJÑJˆÜ˜3ÓÐð 3GÐ.øô+ ó ô 	�ŠØKÈDÈ6ÐQRÐSØò	
ñ 	ðús   ‚B0 Â0#CÃCc                 óš   • [        U 5        [        U 5      n[        R                  U5      nUc  / nU[        U'   UR	                  U 5        U $ r   )rw  r]   r]  rm   r„   )rt  Ú	qual_nameÚfn_overload_lists      r   Ú	_overloadr{    sN   € Ü˜ÔÜ Ó%€Iä&×*Ñ*¨9Ó5ÐØÑØÐØ%5Œ˜	Ñ"Ø×Ñ˜DÔ!Ø€Kr"   c                 ó,   • [         R                  U 5      $ r   )r]  rm   ©ry  s    r   Ú_get_fn_overloadsr~  "  s   € Ü×Ñ˜yÓ)Ð)r"   c                 ó   • [         U 	 g r   )r]  r}  s    r   Ú_clear_fn_overloadsr€  &  s
   € Ü˜	Ñ"r"   c                 ó  • [         R                  " 5       n[        S5       H   nUc  [        SU 35      eUR                  nM"     Uc  [        S5      eUR
                  R                  nUR
                  R                  nX44$ )Nr@   z#current_frame is None at iteration z-current_frame is None after traversing frames)r¢   r£   Úrangerƒ   r¤   Úf_codeÚco_nameÚco_firstlineno)ÚmethodÚcurrent_framer†   Ú
class_nameÚline_nos        r   Úget_class_name_linenorŠ  *  sƒ   € Ü×(Ò(Ó*€Mô �1ŽXˆØÑ Ü Ð#FÀqÀcÐ!JÓKÐKØ%×,Ñ,Šñ ð
 ÑÜÐLÓMÐMØ×%Ñ%×-Ñ-€JØ×"Ñ"×1Ñ1€GØÐÐr"   Ú_overloaded_methodsÚ_overloaded_method_class_filenoc                 ó2  • [        U 5        [        U 5      n[        R                  U5      nUc  0 nU[        U'   [	        U 5      u  p4UR                  U5      nUc  / nXRU'   U[
        X4'   O[
        X4   nXd:w  a  [        S5      eUR                  U 5        U $ )NzmCannot currently overload the same method name in two different classes with the same name in the same module)rw  r]   r‹  rm   rŠ  rŒ  rV   r„   )rt  ry  Úclass_name_maprˆ  r‰  Úmethod_overloadsÚexisting_linenos          r   Ú_overload_methodr‘  K  sµ   € Ü˜ÔÜ Ó%€Iä(×,Ñ,¨YÓ7€NØÑØˆØ)7Ô˜IÑ&ä/°Ó5Ñ€JØ%×)Ñ)¨*Ó5ÐØÑØÐØ%5�zÑ"ØCJÔ'¨Ð(?Ò@ä9¸9Ð:QÑRˆØÓ%ÜðAóð ð
 ×Ñ˜DÔ!Ø€Kr"   c                 ó`  • [        U S5      (       d  g [        U 5      n[        R                  U5      nUc  g UR                  UR                  S 5      nUc  g [        U 5      S   n[        U5      S   nU[        [        U5      S   5      -   nXV:¼  a  XW::  d  [        S[        U 5      -   5      eU$ )Nr$   rt   r   zKOverloads are not usable when a module is redeclared within the same file: )	r3   r]   r‹  rm   r$   r   r�   rƒ   r(   )r†  Ú	mod_classry  rŽ  Ú	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                 ó´   • U [         R                  L a  [        S5        [        U S5      (       d  g[	        U 5      nU R
                  S;   =(       a    U[        L $ )Nr   r%   F©r�   r1   )r1   r   Ú'raise_error_container_parameter_missingr3   r	   r%   r…   ©r7   Ú
ann_origins     r   Úis_tuplerž  }  sK   € à
Œf�l‰lÒÜ/°Ô8ô �3˜×%Ñ%Øä˜C“€JØ�>‰>Ð3Ñ3×K¸
ÄeÐ8KÐKr"   c                 ó´   • U [         R                  L a  [        S5        [        U S5      (       d  g[	        U 5      nU R
                  S;   =(       a    U[        L $ )Nr
   r%   Frš  )r1   r
   r›  r3   r	   r%   r¿   rœ  s     r   Úis_listr   Š  óI   € à
Œf�k‰kÒÜ/°Ô7ä�3˜×%Ñ%Øä˜C“€JØ�>‰>Ð3Ñ3×J¸
ÄdÐ8JÐJr"   c                 ó´   • U [         R                  L a  [        S5        [        U S5      (       d  g[	        U 5      nU R
                  S;   =(       a    U[        L $ )Nr   r%   Frš  )r1   r   r›  r3   r	   r%   Údictrœ  s     r   Úis_dictr¤  –  r¡  r"   c                 óÌ   • U [         L a  [        S5        [        U [        5      =(       d:    [	        U S5      =(       a'    U R
                  S:H  =(       a    [        U 5      [         L $ )Nr   r%   r1   )r   r›  r4   r,   r3   r%   r	   r6   s    r   Úis_unionr¦  ¢  sR   € Ø
Œe‚|Ü/°Ô8ä�cÔ+Ó,÷ Ü��\Ó"÷ 	'Ø�N‰N˜hÑ&÷	'ä˜‹_¤Ð%ðr"   c                 óˆ   • U [         L a  [        S5        S nS nU" U 5      =(       d    [        U 5      =(       a    U" U 5      $ )Nr   c                 óv   • [        U S5      =(       a'    U R                  S:H  =(       a    [        U 5      [        L $ )Nr%   r1   )r3   r%   r	   r   r6   s    r   Úis_optional_as_optionalÚ,is_optional.<locals>.is_optional_as_optional±  s3   € ä�C˜Ó&÷ .Ø—‘ (Ñ*÷.ä˜C“¤HÐ,ð	
r"   c                 óv   • [        U 5      n[        U5      S:H  =(       a    S U;   =(       d    [        S 5      U;   $ )Nr@   )r   r�   r5   )r7   Úann_argss     r   Úis_union_as_optionalÚ)is_optional.<locals>.is_union_as_optional¸  s2   € Ü˜C“=ˆÜ�8‹} Ñ!×R t¨xÑ'7×'Q¼4À»:ÈÑ;QÐRr"   )r   r›  r¦  )r7   r©  r­  s      r   Úis_optionalr¯  ­  s>   € Ø
Œh‚Ü/°
Ô;ò
òSñ # 3Ó'×X¬H°S«M×,WÑ>RÐSVÓ>WÐXr"   c                 óL   • U [         L a  [        S5      e[        U 5      [         L $ )Nz_Attempted to use Future without a contained type. Please add a contained type, e.g. Future[int])r   rV   r	   r6   s    r   Ú	is_futurer±  ¿  s,   € Ø
Œf‚}Üðó
ð 	
ô
 �c‹?œfÐ$Ð$r"   c                 ó8   • U [         L a  g[        U 5      [         L $ )NT)r   r	   r6   s    r   Úis_awaitr³  É  s   € Ø
Œf‚}ØÜ�c‹?œfÐ$Ð$r"   )ÚPyRRef)ÚRRefc                 óL   • U [         L a  [        S5      e[        U 5      [         L $ )Nz[Attempted to use RRef without a contained type. Please add a contained type, e.g. RRef[int])rµ  rV   r	   r6   s    r   Úis_rrefr·  Ó  s,   € Ø”$Š;Üðóð ô
 ˜#‹¤$Ð&Ð&r"   c                 ó"   • [        U [        5      $ r   )r4   r´  ©rZ   s    r   Úis_rref_instancerº  Ü  s   € Ü˜#œvÓ&Ð&r"   c                 ó   • grJ  r   r¹  s    r   rº  rº  á  s   € àr"   c                 óN   • [        U 5      (       d  g [        R                  U 5      $ r   )r9  r.   rm   r  s    r   Ú_try_get_dispatched_fnr½  æ  s   € Ü�B�<‰<ØÜ×!Ñ! "Ó%Ð%r"   Úlocc           
      óô  • Uc
  [        5       n[        U [        5      (       a  [        U S5      (       d  [	        SU  35      e[        U S5      (       a;  U R
                   Vs/ s H#  nX0R                  ;   d  M  U R                  U   PM%     nnO/ n[        R                  " U 5      n[        U5      S:X  a1  [        U S5      (       a   [        R                  " U R                  5      n/ nU R
                   HÛ  nX5;   aœ  XS   n[        U[        5      (       aF  UbC  U" UR                  5      nUc,  [        SU SU R                   SUR!                  5        35      eUn["        R$                  R&                  R)                  XqU5      n	UR+                  U	5        M¤  UR+                  ["        R,                  R.                  R1                  5       5        MÝ     [3        U 5      R                  U R
                  Xd4$ s  snf )	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À   r…   r3   rƒ   rÀ  rÁ  r¢   Úget_annotationsr�   rÂ  r4   r   Ú__forward_arg__Ú
ValueErrorr$   Ú	highlightrN   ÚjitÚannotationsÚann_to_typer„   rO   Ú
TensorTypeÚgetInferredr5   )
rZ   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×Ñ Ô&Ù$ð 	ð 
ˆð ˆä×-Ò-¨cÓ2€OÜ
ˆ?Ó˜qÓ ¤W¨S°*×%=Ñ%=Ü!×1Ò1à�L‰Ló
ˆð
 €KØ—”ˆØÓ#Ø(Ñ/ˆJôH ˜*¤j×1Ñ1°c±oÙ˜z×9Ñ9Ó:�àÑ#Ü$Ø4°Z°LÐ@PÐQT×Q]ÑQ]ÐP^ð _.à.1¯m©m«oÐ->ð@óð ð
 &�
Ü—y‘y×,Ñ,×8Ñ8¸È#ÓNˆHØ×Ñ˜xÖ(à×ÑœuŸx™x×2Ñ2×>Ñ>Ó@ÖAñg ôh �‹9×Ñ˜sŸ{™{¨KÐAÐAùòI
s   Á!G5Á8G5Úunqual_nameÚfield_namesrÎ  c                 ó6   • [         R                  " XUS9nU" U 6 $ )N)rÎ  )ÚcollectionsÚ
namedtuple)ÚtrÔ  rÕ  rÎ  Ú	TupleTypes        r   Ú_create_named_tuplerÛ  @  s    € ô ×&Ò& {È(ÑS€IÙ�aˆ=Ðr"   c               #   ó4  #   • [         R                  R                  5       n [         R                  R                  S S 5         S v •  [         R                  R                  U S   U S   5        g ! [         R                  R                  U S   U S   5        f = f7f©Nr   rt   )rN   rO   Ú_jit_get_emit_hooksÚ_jit_set_emit_hooks)Úhookss    r   Ú_disable_emit_hooksrá  J  sk   é € ä�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                 ó   • SS jnSS jng )Nc                 óŠ   • [         R                  R                  5       U l        [         R                  R	                  S S 5        g r   )rN   rO   rÞ  rà  rß  rd   s    r   Ú	__enter__Ú0_disable_emit_hooks_decorator.<locals>.__enter__V  s*   € Ü—X‘X×1Ñ1Ó3ˆŒ
Ü�‰×$Ñ$ T¨4Õ0r"   c                 óx   • [         R                  R                  U R                  S   U R                  S   5        g rÝ  )rN   rO   rß  rà  )r   rî   s     r   r/  Ú/_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                 óZ   • [         R                  " U 5      (       d  g[        U [        5      $ rJ  )r¢   ÚisclassrÀ   r�   r¹  s    r   Ú_is_exceptionrí  ^  s!   € Ü�?Š?˜3×ÑØÜ�cœ9Ó%Ð%r"   c                 óv   • U R                  S5      (       a  [        SU  SU  S35      e[        SU  SU  S35      e)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])ÚendswithrV   )Útarget_types    r   r›  r›  d  s`   € Ø×Ñ˜E×"Ñ"ÜØ ˜}ð -@àˆm˜:ð'ó
ð 	
ô
 Ø
˜K˜=ð )=àˆ-�uð	óð r"   r£  r¿   r…   r   r
   r   r   c                 óT   • [         R                  U 5      =n(       a  [        U5        g g r   )Ú_RAW_TYPE_NAME_MAPPINGrm   r›  )rñ  rU   s     r   Úcheck_args_existrô  }  s%   € Ü%×)Ñ)¨+Ó6Ð6€tÕ6Ü/°Õ5ð 7r"   c                 óT   • U / :X  d  U 0 :X  d  U S:X  a  [         R                  " SSS9  g g )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@   rg  )r<  r=  r¹  s    r   Úcheck_empty_containersrö  ‚  s0   € Ø
ˆbƒy�C˜2“I ¨£Ü�Šðð
 ó	
ð "+r"   c                 óö  • [        U5      n[        U5        Uc  gU[        L d  U[        R                  L aq  [        U 5        [        U [        5      (       d  g[        U5      S   n[        U5      nU  H0  nU(       a  [        XS5      (       d    gM  [        XS5      (       a  M0    g   gU[        R                  L d	  U[        L a¡  [        U 5        [        U [        5      (       d  g[        U5      S   n[        U5      S   nU R                  5        HO  u  p‰[        X†5      (       d    g[        U5      n
U
(       a  [        X—5      (       d    gM=  [        X—5      (       a  MO    g   gU[        R                  L d	  U[        L a’  [        U 5        [        U [        5      (       d  g[        U5      n[        U 5      [        U5      :w  a  g[        X5       H=  u  p\[        U5      nU(       a  [        X\5      (       d    gM+  [        X\5      (       a  M=    g   gU[         L d  [#        U[$        5      (       aI  U c  g[        U5      nU H4  n[        U5      nU(       a  [        X5      s  $ [        X5      (       d  M4    g   g)NFr   Trt   )r	   rô  r¿   r1   r
   rö  r4   r   Úcontainer_checkerr   r£  rÍ   r   r…   r�   Úzipr   rÀ   r,   )rZ   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æÜ(¨×6Ñ6Ù ñ 7ä ×-Ó-Ùñ ð Ø	œŸ™Ò	# {´dÒ':Ü˜sÔ#Ü˜#œt×$Ñ$ØÜ˜KÓ(¨Ñ+ˆÜ˜KÓ(¨Ñ+ˆØŸ	™	ž‰HˆCä˜c×,Ñ,ÙÜ# HÓ-ˆJÞÜ(¨×7Ñ7Ù ñ 8ä ×.Ó.Ùñ $ð Ø	œŸ™Ò	$¨´uÒ(<Ü˜sÔ#Ü˜#œu×%Ñ%ØÜ˜[Ó)ˆ	Üˆs‹8”s˜9“~Ó%ØÜ˜sÖ.‰KˆBÜ" 7Ó+ˆIÞÜ(¨×5Ñ5Ù ñ 6ä ×,Ó,Ùñ /ð Ø	œÒ	¤ØÜ÷"ñ "ð ‰;ØÜ˜{Ó+ˆÛˆAÜ! !“}ˆHÞÜ(¨Ó0Ò0Ü˜C×#Ó#Ùñ ð r"   c                 ó2  • [        U[        R                  R                  5      (       a<  [        U[        5      (       d  [        S5      eU H  n[        X5      (       d  M    g   g[        U5      nU(       a  [        X5      $ [        U5        [        X5      $ )NzPThe second argument to `torch.jit.isinstance` must be a type or a tuple of typesTF)
r4   r×  ÚabcÚ	Containerr…   rV   Ú_isinstancer	   rø  rô  )rZ   rñ  Út_typerú  s       r   r
  r
  Ó  s†   € Ü�+œ{Ÿ™×8Ñ8×9Ñ9Ü˜+¤u×-Ñ-Üð&óð ó
 "ˆFÜ˜3×'Ó'Ùñ "ð ä˜[Ó)€KÞÜ  Ó2Ð2ô �[Ô!ô �cÓ'Ð'r"   c                   óP   ^ • \ rS rSrS\\R                     4U 4S jjrS rSr	U =r
$ )Ú_TensorExtractoriì  Útensorsc                ó2   >• [         TU ]  " U0 UD6  Xl        g r   )Úsuperre   r  )r   r  rî   r  Ú	__class__s       €r   re   Ú_TensorExtractor.__init__í  s   ø€ Ü‰Ò˜$Ð) &Ò)Ø�r"   c                 ó²  • [        U[        R                  5      (       a  U R                  R	                  U5        g[        U[
        5      (       a  g[        U[        5      (       d  [        U5      (       a  g[        U[        5      (       a  g[        U[        R                  R                  5      (       a  g[        U[        R                  5      (       a  gg )Nr_  )r4   rN   ÚTensorr  r„   r-   ÚCFuturerº  ÚCAwaitÚcudaÚEventÚ	threadingÚThread)r   rZ   s     r   Úpersistent_idÚ_TensorExtractor.persistent_idñ  sš   € Ü�cœ5Ÿ<™<×(Ñ(Ø�L‰L×Ñ Ô$Øô �cœ8×$Ñ$Øô �cœ7×#Ñ#Ô'7¸×'<Ñ'<ØÜ�cœ6×"Ñ"ØÜ�cœ5Ÿ:™:×+Ñ+×,Ñ,ØÜ�cœ9×+Ñ+×,Ñ,ØØr"   )r  )r$   r%   r&   r'   r¿   rN   r  re   r  r)   Ú__classcell__)r  s   @r   r  r  ì  s"   ø† ð t¨E¯L©LÑ'9÷ ÷ð r"   r  c                 óh   • / n[        [        R                  " 5       SUS9nUR                  U 5        U$ )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)rZ   r  Ú	extractors      r   Ú_extract_tensorsr%  
  s.   € ð #%€GÜ ¤§¢£¸ÀGÑL€IØ‡N�N�3ÔØ€Nr"   c                 ó  • [        U [        R                  R                  5      (       a#  [	        U R
                  R                  5       5      $ [        U [        R                  R                  5      (       a  U R                  $ g r   )	r4   rN   rÇ  ÚScriptModuler(   Ú_cÚ_typerP   rQ   r¹  s    r   Ú_get_model_idr*    sT   € Ü�#”u—y‘y×-Ñ-×.Ñ.Ü�3—6‘6—<‘<“>Ó"Ð"Ü	�CœŸ™×1Ñ1×	2Ñ	2Ø×!Ñ!Ð!àr"   )rs  é   )T)r   )Frè  )NN)�r  rÕ   r�   r×  Ú
contextlibrS   r¢   r!  ÚpickleÚsysrê   r  r=   r1   r<  Úweakrefr   r   r   r   r   r   r	   r
   r   r   r   r   r   r2   r   rN   Útorch.distributed.rpcÚtorch.package._manglingÚpackageÚ	_manglingrW   Útorch._awaitsr   Útorch._Cr  r   r  Útorch._sourcesr   r   r   Útorch.futuresr   r*   r+   Ú	UnionTyper,   r5   r…   Ú__annotations__Ú_threadr-   ÚImportErrorÚ_dummy_threadÚWeakKeyDictionaryr.   ÚFAKE_FILENAME_PREFIXr:  r8   r:   ÚBroadcastingList1r‚  r†   ÚglobalsrD   r(   r]   r_   rä   r–   r•   r¦   r²   rº   rÉ   r¿   rÓ   rÚ   rþ   r  r  r  r  r%  ÚAbstractContextManagerr'  r?  rA  rC  rH  rK  r¼   rO  rT  rW  rE  r\  r]  r£  ra  re  rw  r{  r~  r€  rŠ  r‹  rŒ  r‘  r˜  rž  r   r¤  r¦  r¯  r±  r³  ÚdistributedÚrpcÚis_availableÚtorch._C._distributed_rpcr´  rµ  r·  rº  r½  rO   Ú_jit_tree_viewsÚSourceRangerÓ  rÛ  Úcontextmanagerrá  rê  rí  r›  ró  rô  rö  rø  r
  ÚPicklerr  r%  r*  Úversion_inforT   Ú__new__Ú
__format__Ú__repr__Ú__str__r   r"   r   Ú<module>rO     sÓ  ðòó Û Û Û Û Û Û 	Û Û 
Û Û Û Û Û Û ÷÷ ÷ õ õ (ã ó
 ß 2Ð 2Ý  ß 8ß KÑ KÝ  ô0�ô 0ñ ˆtƒ_€ÙˆTƒ]€à,1¯O©OÐ �$˜˜t S˜yÑ)Ñ)Ó ;à
ƒð&Ûà×Ñ€Hð ×ÒÓð Ð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   ÃQ2 Ñ2RÒR