
    9i%                    .   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
JrJr  SSKrSSKJr  SSKJs  Jr  SSKJrJrJrJr  SSKJrJr  SSKJr  SSK J!r!J"r"J#r#  SS	K$J%r%J&r&  SS
K'J(r(  SSK)J*r*J+r+J,r,J-r-J.r.J/r/  SSKJ0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7  SSK8J9r9  SSK:J;r;  SSK<J=r=J>r>  SSK?J@r@JArAJBrB  \(       a  SSKCJDrD  SSKEJFrF   " S S5      rG " S S\95      rH " S S\95      rI " S S\95      rJ " S S\J5      rK " S S\95      rL " S  S!\95      rM " S" S#\95      rNS$ rO " S% S&\95      rP\R                   " S' S(5      5       rR " S) S*\B5      rS " S+ S,\B5      rT " S- S.\95      rU " S/ S0\95      rV " S1 S2\95      rW " S3 S4\95      rX " S5 S6\95      rY " S7 S8\95      rZ\R                  " SS99S: 5       r\\R                  " SS99S; 5       r] " S< S=\95      r^ " S> S?\95      r_ " S@ SA\95      r` " SB SC\95      ra " SD SE\95      rb " SF SG\95      rc " SH SI\95      rd " SJ SK\d5      re " SL SM\d5      rf " SN SO\d5      rg " SP SQ\d5      rh " SR SS\d5      ri\R                  \h\R                  \h\R                  \i0rm " ST SU\95      rn " SV SW\95      ro " SX SY\95      rpg)Za  
This module contains miscellaneous variable tracker implementations for various Python types
and features used in Dynamo's symbolic execution. These classes help track and propagate
information about different kinds of variables during graph capture.

Key classes include:
- SuperVariable: Handles super() calls and method resolution
- ExceptionVariable: Tracks exception objects
- RandomVariable: Manages random number generators
- GetAttrVariable: Tracks attribute access
- MethodWrapperVariable: Handles method wrappers
- PythonModuleVariable: Tracks Python modules
- NumpyVariable: Handles numpy functions and types
- StringFormatVariable: Manages string formatting
- DebuggingVariable: Handles print and logging
    N)OptionalTYPE_CHECKING   )configgraph_break_hintstrace_rules	variables)create_call_functioncreate_instruction)$do_not_convert_to_tracable_parameter)raise_observed_exceptionunimplementedunimplemented_v2)GuardBuilderinstall_guard)unpatched_nn_module_init)
AttrSourceGenericAttrSourceGetItemSourceTypeMROSource
TypeSourceWeakRefCallSource)check_unspec_or_constant_argscmp_name_to_op_mappingidentityis_tensor_base_attr_getteristypelist_methodsproxy_args_kwargstuple_methods   )VariableTracker)ConstantVariable)NestedUserFunctionVariableUserFunctionVariable)call_random_fnis_standard_setattrUserDefinedObjectVariable)	PyCodegen)InstructionTranslatorc                       \ rS rSrSrg)NO_SUCH_SUBOBJF    N)__name__
__module____qualname____firstlineno____static_attributes__r.       \/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/torch/_dynamo/variables/misc.pyr,   r,   F   s    r4   r,   c                      ^  \ rS rSr1 \R
                  krSSU 4S jjjrSU 4S jjrSU 4S jjrSSS\	SS	4S
 jr
        SS jrSrU =r$ )SuperVariableJ   returnc                 >   > [         TU ]  " S0 UD6  Xl        X l        g Nr.   )super__init__typevarobjvar)selfr>   r?   kwargs	__class__s       r5   r=   SuperVariable.__init__O   s!    "6" 
 r4   c                   >^ TR                  UU4S j5        T" U R                  5        U R                  b.  T" U R                  5        TR                  [	        SS5      5        g TR                  [	        SS5      5        g )Nc                  D   > T" [         R                  " [        5      5      $ N)r	   BuiltinVariabler<   )rB   codegens   r5   <lambda>+SuperVariable.reconstruct.<locals>.<lambda>\   s    gi.G.G.N&Or4   r   Fr!   )add_push_nullr>   r?   extend_outputr
   )r@   rH   rB   s    `r5   reconstructSuperVariable.reconstruct[   s`    OP;;"DKK !!"6q%"@A!!"6q%"@Ar4   txr*   c                 z  > U R                   (       d   S5       eU R                  R                  5       nU R                   R                  5       nU R                   R                  (       a  [        U R                   R                  5      OS n[        U[        5      (       a,  U R                   R                  nU R                   R                  nS nUR                  n UR                  U5      S-   n[        U[        U5      5       Hb  n	Xy   R                   R#                  U[$        5      =n
(       d  M.  U
[$        Ld  M9  U(       a  ['        [)        [+        U5      U	5      U5      nX4s  $    [-        SSSU SU R                   SU R                    S3S	S
/S9  g ! [         a    [        [        X45      U5      S 4s $ f = f)Nz1-arg super not implementedr!   zUnable to resolve super getattr z"Dynamo failed to trace attribute `z$` accessed via `super()` (for type `z` and object `z8`) because the resolved attribute type is not supported.z0Ensure the attribute exists in the parent class.z(Check the arguments passed to `super()`.gb_typecontextexplanationhints)r?   r>   as_python_constantpython_typesourcer   
issubclasstypevalue__mro__index
ValueErrorgetattrr<   rangelen__dict__getr,   r   r   r   r   )r@   rO   namesearch_typetype_to_usetype_to_use_sourcerY   
search_mrostart_indexr^   resolved_getattrrB   s              r5   _resolved_getattr_and_source*SuperVariable._resolved_getattr_and_sourced   s   {{999{ll557 kk--/.2kk.@.@Jt{{))*d 	 k4((++++K!%!3!3 ((
	H$**;7!;K ;J8E#-#4#=#=#A#A$#WWW#>9)!+)-8J*KUS " ,33 9 	5<TF C((,~^DKK= QDD C:
	
'  	H 5:DA4GG	Hs   F !F:9F:re   r"   c                    U R                  X5      u  p4[        R                  R                  U5      (       d  [	        X5      $ U(       a(  [        UR                  [        R                  5      5        [        R                  R                  X4S9$ )NrY   )
rl   r	   r#   
is_literalGetAttrVariabler   
make_guardr   CONSTANT_MATCHcreate)r@   rO   re   r\   rY   s        r5   var_getattrSuperVariable.var_getattr   sn     99$E))44U;;"4..&++L,G,GHI))000FFr4   c                    U R                  X5      u  pVU[        R                  L a  [        [        5      $ U[
        R                  R                  R                  L a  U R                  nSSK	J
n  [        U[        R                  5      (       at  [        UR                  U5      (       aY  U(       dR  U(       dK  [        5          [        R                   " ["        US9R%                  XR                  /U-   U5      sS S S 5        $ ['        SSU  SU SU SU 3SU S3/ [(        R*                  QS	9  GO'U R                  R,                  (       a  [/        US
5      (       a  UR0                  S:X  a  [        R2                  R5                  U5      (       aw  UR6                  n	[/        U	S5      (       a'  U	R8                  S:X  a  [        R:                  " U	5      n
O UR<                  n[        R2                  " XS9n
U
R?                  USX45      $ [        U[@        5      (       aX  [        URB                  [D        RF                  5      (       a/  [        R                   " URB                  US9R%                  XU5      $ [        U[H        5      (       Ga  [        URB                  [D        RF                  5      (       a  [        U R                  [        R2                  5      (       a  U R                  nOgS nU R                  R,                  (       a  [K        U R                  R,                  5      n[L        RN                  " XR                  RP                  U5      n[        R                   " URB                  [S        US5      S9R%                  X/UQU5      $ [        U[D        RF                  5      (       a2  [        R                   " XVS9R%                  XR                  /U-   U5      $ [        U[D        RT                  5      (       a:  [        RV                  " URB                  U R                  US9R%                  XU5      $ [Y        U5      (       a?  [        U R                  [        5      (       a   U R                  RZ                  " U/UQ70 UD6$ U[        R\                  L a  US   n UR_                  5       nURb                  R                  Re                  U R                  5      (       d1  ['        SSU  SU 3SU R                   S3S/[(        Rf                  QS	9  URb                  R                  Ri                  U R                  U[        Rj                  " 5       5        [        Rl                  " S 5      $ [        U R                  [        Rn                  5      (       a?  XPR                  Rp                  ;   a&  U R                  Rr                  R?                  XX45      $ [        U R                  [        Rt                  5      (       a?  XPR                  Rv                  ;   a&  U R                  Rx                  R?                  XX45      $ [        U R                  [        Rz                  5      (       a0  U[|        ;   a&  U R                  R~                  R?                  XX45      $ [        U R                  [        R                  5      (       a0  U[        ;   a&  U R                  R                  R?                  XX45      $ U[        R                  L Ga   US   R                  nURb                  R                  R                  U R                  U5      (       a`  URb                  R                  R                  U R                  USS9n[        U[        Rj                  5      (       a  [        [        U5        U$  [        R                  U R                  R                  U5      nS nU R                  R,                  b   [        U R                  R,                  U5      n[L        RN                  " UWU5      $ U[
        R                  R                  L a  US   n0 nUS   R                  nUS   R                  R                  5        H%  u  nnUR                  R_                  5       nUUU'   M'     UR                  R                  nSUR                  lO         UR%                  UUU5      UUR                  lO        $ [        U[D        R                  5      (       aP  U[        R                  " 5       ;   a7  [L        RN                  " XU5      nUR%                  XR                  /U-   U5      $ ['        SSU  SU 3SU SU S3S /S	9  g ! , (       d  f       N)= f! [`         a  n['        SSU  SU 3SS/US9   S nAGNS nAff = f! [         a    [        [        U5         GNf = f! UUR                  lO        f = f)!Nr   )AttributeMutationNewro   z#Unsupported super().__init__() callcall_method  z0Dynamo encountered a super().__init__() call on zK that resolved to a `torch.nn.Module.__init__()` call that we cannot trace.rR   r/   __new__r0   builtins__func__r   z7Non-constant attribute given to `super().__delattr__()`zbDynamo requires the attribute name passed to `super().__delattr__(...)` to be a constant (string).zEEnsure the attribute name is a string literal or a constant variable.)rS   rT   rU   rV   from_exczFAttempted super().__delattr__() on an object without mutation trackingzmDynamo needs to track mutations on an object before `super().__delattr__` can be used on it. But the object (z3) doesn't have attribute mutation tracking enabled.z<Ensure the object is tracked by Dynamo's side effect system.T)
deleted_ok   FzFAttempted to call a super() attribute that is not a function or methodz4Dynamo does not know how to trace the call `super().z()` because `super().z(` is not a function or method attribute.zMEnsure the attribute accessed via `super()` is a standard method or function.)Srl   objectr=   LambdaVariabler   torchnnModuler?   side_effectsrx   
isinstancer	   r(   mutation_typer   r%   r   call_functionr   r   	DIFFICULTrY   hasattrr/   UserDefinedClassVariableis_supported_new_method__self__r0   rG   membercall_methodstaticmethodr}   typesFunctionTypeclassmethodr   r"   build
value_typer   
MethodTypeUserMethodVariabler'   method_setattr_standard__delattr__rW   NotImplementedErroroutputis_attribute_mutation
DYNAMO_BUG
store_attrDeletedVariabler#   UserDefinedDictVariable_dict_methods_dict_vtUserDefinedSetVariable_set_methods_set_vtUserDefinedTupleVariabler    	_tuple_vtUserDefinedListVariabler   _list_vt__getattribute__r\   has_pending_mutation_of_attr	load_attrr   AttributeErrorr   _C_disabled_torch_function_implitemsvtsymbolic_torch_function_statetorch_function_subclass_enabledMethodDescriptorTyper   get_tensor_method)r@   rO   re   argsrA   inner_fnrY   r?   rx   user_clsuser_cls_vtuser_cls_sourcecls_variable
cls_sourceattrexc	attr_nameresult
attr_valueattr_sourcefunc	tf_kwargstf_argshash_key_vtvalue_vtkey_strtx_oldfn_vars                               r5   r   SuperVariable.call_method   sB     <<TH v&!(++111[[F; 69#F#FGGv335IJJ9;$990#mB(<fE <;
 !A*4&$qaxH!  "1!1 9-778 KK*--!!Y.22JJ8TT((Hx..83F3F*3T'77A"(--'@@ **2y$GG,//Ju115
 5
 11!!&mBf-. +..:u114
 4
 $++y'I'IJJ  ${{ "
;;%%!+DKK,>,>!?J.44..
  11!!*VZ*HmB 5 5v>? %"4"45511mB 4f=> %"2"233//!!4;;vmBf-. !**zKK20
 0
 ;;66rKDKFKK+++7D..0 99))??LL d*4&$8!#{{m ,(!(
 W*55 II""--T9#<#<#> --d33t{{I$E$EFFKK555;;''33BdKKt{{I$D$DEEKK444;;&&222TJJt{{I$F$FGGM);;((44RtLLt{{I$E$EFFL(;;''33BdKK000 QIyy%%BBY  //99KKt :  fi&?&?@@,^R@=#44T[[5F5F	R
 K{{!!-/0B0BIN"((ZEE???
 7DI1gmmG)-a)<)<)>%X%..;;=%-	'" *? 55UUFOTB,,L))"gyA  00P x!;!;<<K99;; %**2@F''[[MD,@&II'"4&$0v24& 9,, `
	
e <;V ' 
 U*4&$8!L ` !	 	
D " =(<=4  00PsB   7e2f (*f/ g 2
f 
f,f''f,/ggg#)r?   r>   rF   r9   NrH   r)   rO   r*   rO   r*   r   list[VariableTracker]rA   dict[str, VariableTracker]r9   r"   )r/   r0   r1   r2   r"   _nonvar_fieldsr=   rM   rl   strru   r   r3   __classcell__rB   s   @r5   r7   r7   J   s    		'	'N
 
B5
nG5 GS GEV G W
#W
 &	W

 -W
 
W
 W
r4   r7   c                   ~   ^  \ rS rSrSU 4S jjrSS jrSS jrS rSSS\S	\4S
 jr	U 4S jr
U 4S jrS r\rSrU =r$ )ExceptionVariablei  c                    > [         TU ]  " S0 UD6  Xl        X l        [	        S 5      U l        [	        S 5      U l        [	        S5      U l        [	        S 5      U l        g )NFr.   )	r<   r=   exc_typer   r#   __context__	__cause____suppress_context____traceback__)r@   r   r   rA   rB   s       r5   r=   ExceptionVariable.__init__  sV    "6" 	 ,D1 *$/$4U$;! .d3r4   c                     Xl         g rF   )r   )r@   rT   s     r5   set_contextExceptionVariable.set_context  s    "r4   c                   ^ ^ TR                  UU 4S j5        TR                  T R                  5        TR                  [	        T R                  5      S5        S[
        SS 4UU 4S jjnU" S5        U" S5        U" S5        g )	Nc                  P   > T R                  STR                  R                  5      $ )Nr|   )load_import_fromr   r/   rH   r@   s   r5   rI   /ExceptionVariable.reconstruct.<locals>.<lambda>  s    G,,Z9O9OPr4   Fre   r9   c                 
  > [        TU 5      n[        U[        5      (       a  UR                  S;   d   U5       eg TR	                  5         T" U5        TR                  TR                  S5      5        TR                  U 5        g )N)TFNr   )r`   r   r#   r\   dup_toprL   rot_nr   )re   r   rH   r@   s     r5   codegen_attr3ExceptionVariable.reconstruct.<locals>.codegen_attr  sk    4&Dd,--zz%88>$>8!%%gmmA&67""4(r4   r   r   r   )rK   foreachr   r   rb   r   )r@   rH   r   s   `` r5   rM   ExceptionVariable.reconstruct  sq    P	
 			"c$))ne4	)s 	)t 	) 	) 	]#[!+,r4   c                     U R                   $ rF   )r   r@   s    r5   rX   ExceptionVariable.python_type  s    }}r4   rO   r*   name_varvalc                   ^ U4S jnUR                  5       nUS:X  a  U R                  U5        GODUS:X  a  [        U[        5      (       a  UR                  bM  [        U[
        R                  [
        R                  [
        R                  [
        R                  45      (       a"  X0l
        [
        R                  " S5      U l        OU" S5        OUS:X  a5  [        U[        5      (       a  UR                  S;   a  X0l        OrU" S5        OiUS:X  a=  [        U[        5      (       a  UR                  c  X0l        O:[        S	S
U  SU 3SS/S9  O&[        SS
U  SU 3SU S3/ [        R                  QS9  [
        R                  " S 5      $ )Nc                 8   > [        [        T[        U 5      /S9  g )N)r   )r   	TypeErrorr#   )msgrO   s    r5   raise_error3ExceptionVariable.call_setattr.<locals>.raise_error  s    $Y:J3:O9PQr4   r   r   Tz9exception cause must be None or derive from BaseExceptionr   )TFr   z<Set Exception object `__traceback__` attribute to not-`None`zcall_setattr rz   zwDynamo does not support setting the attribute '__traceback__' on tracked exception objects to anything other than None.zYAvoid setting '__traceback__' on exception objects within traced code, or set it to None.rR   z4Unsupported attribute assignment on Exception objectz/Dynamo does not support setting the attribute 'z{' on tracked exception objects. Only `__context__`, `__cause__`, `__suppress_context__`, and `__traceback__` are supported.)rW   r   r   r#   r\   r	   rG   r   !UserDefinedExceptionClassVariable"UserDefinedExceptionObjectVariabler   r   r   r   r   SUPPORTABLE)r@   rO   r   r   r   re   s    `    r5   call_setattrExceptionVariable.call_setattr  s   	R **,= S![ 3 011cii6GJ--//??@@	M M "%,5,F,Ft,L)WX++#/00SYY-5O,/)WX_$#/00SYY5F%(" Z+D64&9!'A
 N'vQtf56 ZZ 7)556 ))$//r4   c                    > US:X  a  U R                   " U/UQ76 $ US:X  a"  Uu  nU R                  U[        S5      U5        U $ [        TU ]  XX45      $ )N__setattr__with_tracebackr   )r   r#   r<   r   )r@   rO   re   r   rA   tbrB   s         r5   r   ExceptionVariable.call_method  s`    = $$R/$//%%DRb"2?"CRHK7&r>>r4   c                 $  > US:X  a  U R                   $ US:X  a  U R                  $ US:X  a  U R                  $ US:X  a  [        R                  " S 5      $ US:X  a)  [        R
                  " U R                  U R                  S9$ [        TU ]%  X5      $ )Nr   r   r   r   r   ro   )
r   r   r   r	   r#   ListVariabler   rY   r<   ru   )r@   rO   re   rB   s      r5   ru   ExceptionVariable.var_getattr  s    = ###[ >>!++,,,_$--d33V^))$))DKKHHw"2,,r4   c                 N    U R                   R                   SU R                   S3$ )N())rB   r/   r   r   s    r5   __str__ExceptionVariable.__str__  s$    ..))*!DMM?!<<r4   )r   r   r   r   r   r   r   )rT   r   r   )r/   r0   r1   r2   r=   r   rM   rX   r"   r   r   ru   r
  __repr__r3   r   r   s   @r5   r   r     sO    4"#-*70#70 "70 	70r?-= Hr4   r   c                       \ rS rSrSrSrg)UnknownVariablei	  z
It could be anything!
r.   Nr/   r0   r1   r2   __doc__r3   r.   r4   r5   r  r  	  s    r4   r  c                   J   ^  \ rS rSrSrSU 4S jjr        SS jrSrU =r$ )DelayGraphBreakVariablei  zV
Used to insert a dummy variable in the stack to do the graph break at CALL_FUNCTION.
c                 2   > [         TU ]  " S0 UD6  Xl        g r;   )r<   r=   r   )r@   r   rA   rB   s      r5   r=    DelayGraphBreakVariable.__init__  s    "6"r4   c                     [        SSU R                   3SU R                  R                  5        SU R                   3/ S9  g )Nz#Unsupported function call (delayed)zsource: z@Dynamo determined that a graph break should occur when calling `z`. Reason: rR   )r   rY   re   r   r@   rO   r   rA   s       r5   r   %DelayGraphBreakVariable.call_function  sH     	9t{{m,![[--/0DHH:G	
r4   )r   rF   r   	r/   r0   r1   r2   r  r=   r   r3   r   r   s   @r5   r  r    s=    
#
 &
 -	

 

 
r4   r  c                   R    \ rS rSrSrSS jrSSS\SS4S	 jr        SS
 jrSr	g)ComptimeVariablei'  zU
This variable is special, it lets you execute arbitrary code at
Dynamo compile time
c                     [        S5      e)Nzcomptime is special form)r   r@   rH   s     r5   rM   ComptimeVariable.reconstruct-  s    !"<==r4   rO   r*   re   r9   r"   c                 b    SSK J n  SSKJn  U" [        X25      [	        U R
                  U5      S9$ )Nr   )comptimer!   )r%   ro   )r  	functionsr%   r`   r   rY   )r@   rO   re   r  r%   s        r5   ru   ComptimeVariable.var_getattr0  s,    ' 	4#H#Jt{{D,I
 	
r4   c                    SSK Jn  U(       a   e[        U5      S::  d   eUS   n[        U[        5      (       a  UR                  5       " U" U5      5        O[        U[        5      (       a  UR                  5       nUR                  (       a   SUR                   35       e[        R                  " UUR                  UR                  R                  5       UR                  (       a  [!        UR                  R"                  5      OS S5      nU" U" U5      5        O[%        S['        U5       35      e[(        R*                  R-                  S 5      $ )Nr   )ComptimeContextr   zOcomptime function must not have free variables, but these variables were free: r.   z"unsupported argument to comptime: )r  r#  rb   r   r%   get_functionr$   get_codeclosureco_freevarsr   r   	f_globalsfn_namerW   defaultstupler   RuntimeErrorr[   r	   r#   rt   )r@   rO   r   rA   r#  fncoder   s           r5   r   ComptimeVariable.call_function:  s    	/ z4yA~~!Wb.//OOob12677;;=Dzz 2262B2B1CE> %%

--/,.KKbkk''(T D $%!CDH:NOO))0066r4   r.   Nr   r   )
r/   r0   r1   r2   r  rM   r   ru   r   r3   r.   r4   r5   r  r  '  sS    
>
5 
S 
EV 
'7#'7 &'7 -	'7
 
'7r4   r  c                   f   ^  \ rS rSr% \\   \S'   Sr\\   \S'    SS\\   SS4U 4S jjjr	Sr
U =r$ )	CellVariableid  pre_existing_contentsN
local_namer9   c                 2   > [         TU ]  " S0 UD6  Xl        g r;   )r<   r=   r2  )r@   r2  rA   rB   s      r5   r=   CellVariable.__init__q  s     	"6"%:"r4   )r2  rF   )r/   r0   r1   r2   r   r"   __annotations__r3  r   r=   r3   r   r   s   @r5   r1  r1  d  sF     $O44 !%J$ BF;%-o%>;	; ;r4   r1  c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )NewGlobalVariableix  c                 &   > [         TU ]  " S0 UD6  g r;   r<   r=   r@   rA   rB   s     r5   r=   NewGlobalVariable.__init__y      "6"r4   r.   r   )r/   r0   r1   r2   r=   r3   r   r   s   @r5   r8  r8  x  s    # #r4   r8  c                 *   ^  U 4S jn[         Ul        U$ )Nc                  (   > TR                   " U 0 UD6$ rF   )apply)r   rA   fn_clss     r5   trampoline_autograd_applyDproduce_trampoline_autograd_apply.<locals>.trampoline_autograd_apply~  s    ||T,V,,r4   )!produce_trampoline_autograd_apply_origin)rA  rB  s   ` r5   rD  rD  }  s    - )J%$$r4   c                      ^  \ rS rSrSrS1\R                  krS
U 4S jjrSS jrSS jr	SS jr
      SS jrS	rU =r$ )AutogradFunctionVariablei  z-represents a torch.autograd.Function subclassrA  c                 2   > [         TU ]  " S0 UD6  Xl        g r;   )r<   r=   rA  )r@   rA  rA   rB   s      r5   r=   !AutogradFunctionVariable.__init__  s    "6"r4   c           
        ^^ SmUU4S jn[         R                  " XBU45        T(       Ga  [        R                  " 5       (       Ga  [        R
                  SL a  [        R                  " S5        SSKJ	n  SSK
Jn  U R                  R                  nU" U R                  R                  5      nU(       a1  U" U R                  R                  U R                  R                  5      nU R                  R                  n	U	[        R                   R"                  R                  La'  [%        SSU  S	U S	U 3S
SS/[&        R(                  QS9  U R                  R*                  n
U
[        R                   R"                  R*                  La&  [%        SSU  S	U S	U 3SS/[&        R(                  QS9  SSKJn  U R0                  nUcC  [3        TR5                  U R                  R6                  5      U R                  R8                  5      nU" UU R                  R:                  U[3        USS9S9R=                  TX#5      nU R0                  (       a  [3        U R0                  S5      n[?        URA                  [B        RD                  5      5        U(       a>  [3        U R0                  S5      n[?        URA                  [B        RD                  5      5        U$ U R0                  (       a  [3        U R0                  S5      nOS nU R                  R                  n[F        RI                  TX#5      nU/UQn[K        U[L        RN                  5      (       ae  [P        RR                  " U5      n[U        U5      S-
  [U        URV                  5      :X  a  USS  n[X        RZ                  " UUS9R=                  TX#5      $ [K        U[L        R\                  5      (       aN  [X        R^                  " UR`                  [X        Rb                  " U R                  5      US9R=                  TX#5      $ [%        SSU  S	U S	U 3S[e        U5      R8                   S3S/S9  g )NFc                    > [        U [        R                  5      (       a  U R                  SLa  Sm[        U [        R                  5      (       a  U R                  T5      (       a  Smg g g )NFT)r   r	   TensorVariablerequires_gradNNModuleVariableis_training)r   rM  rO   s    r5   visit2AutogradFunctionVariable.call_apply.<locals>.visit  sZ    "i6677##50$(M"i8899>>"%%$(M & :r4   zNThe config.capture_autograd_function flag is deprecated, it's now always true.r   )#autograd_function_forward_rewritten)_is_setup_context_definedzUnsupported custom vjpzcall_apply rz   zgDynamo does not support tracing `torch.autograd.Function` subclasses that define a custom `vjp` method.z+Remove the custom `vjp` method if possible.z.Use standard `backward` instead if applicable.rR   zUnsupported custom jvpzgDynamo does not support tracing `torch.autograd.Function` subclasses that define a custom `jvp` method.z+Remove the custom `jvp` method if possible.r!   )AutogradFunctionApplyVariabler@  )r   ro   forwardsetup_contextz=Non-function or method in subclass of torch.autograd.FunctionzDynamo requires the `forward` attribute of a `torch.autograd.Function` subclass to be a standard Python function or method. Found type `z
` instead.zPEnsure the `forward` method is defined as a regular function or instance method.)3r"   rP  r   is_grad_enabledr   capture_autograd_functionwarningswarn"torch._functorch.autograd_functionrR  torch.autograd.functionrS  rA  rU  rV  vjpautogradFunctionr   r   r   jvphigher_order_opsrT  rY   r   import_sourcer0   r/   backwardr   r   rr   r   FUNCTION_MATCHAutogradFunctionContextVariablert   r   r   r   inspect	signaturerb   _parametersr	   r%   r   r   r}   r   r[   )r@   rO   r   rA   rP  rR  rS  
forward_fnis_setup_ctx_definedvjp_fnjvp_fnrT  rY   r   fwd_srcsetup_ctx_srcr-  ctxsigrM  s    `                 @r5   
call_apply#AutogradFunctionVariable.call_apply  s   	) 	eF^4U2244//58d J,,J#<T[[=V=V#W # AKK'')B)B
 [[__FU^^44888 4)$qax@!- FH +66 [[__FU^^44888 4)$qax@!- F*66
 H[[F~#$$T[[%;%;<dkk>R>R 0$$!&9	
 mB-  {{$T[[)<g001L1LMN'$.t{{O$LM!-":":<;V;V"WXJ;;Y7FF[[  -44RF|d|b%,,--##B'C4y1}COO 44ABx11"VDRRD  E,,--//224;;? mB-	. W%dV1TF!F8<33783D3D2EZQ3
r4   c                 b   U R                   R                  n[        US   R                  5      [        R
                  R                  R                  L d   e[        U[        R                  5      (       d   e[        U R                  S5      n[        R                  " XES9R                  XU5      $ )Nr   rc  ro   )rA  rc  r[   r\   r   _dynamoexternal_utilsFakeBackwardCFunctionr   r   r   r   rY   r	   r%   r   )r@   rO   r   rA   r-  	fn_sources         r5   call_backward&AutogradFunctionVariable.call_backward  s    [[!!DGMM"emm&B&B&X&XXXX"e001111t{{J7	--bCQQf
 	
r4   c                 ,    [        U R                  5      $ rF   )rG  rA  r  s       r5   r   &AutogradFunctionVariable.call_function  s    '44r4   c           
         SSK Jn  US:X  ax  [        R                  " U R                  5      (       aA  [        U R                  5      nU" UUR                  R                  " SU/[        X45      Q76 S9$ U R                  XU5      $ US:X  a  U R                  XU5      $ U R                  b  [        U R                  U5      OS n [        R                  " U R                  U5      n[!        U["        5      (       a}  UR%                  U R                  5      n	Ub3  [        R&                  " U	5      R)                  XS9R+                  XU5      $ [        R&                  " U	5      " U	5      R+                  XU5      $ [!        U[,        5      (       a/  [.        R0                  " UR2                  XS9R+                  XU5      $ [5        SS	U  S
U 3SU S3S/S9  g ! [         a    S n Nf = f)Nr!   )wrap_fx_proxyr@  r   )rO   proxyrc  ro   z$Unsupported autograd.Function methodry   rz   ,Dynamo does not support calling the method `z` directly on the `torch.autograd.Function` instance. Supported methods include `apply`, `backward`, static methods, and class methods.znEnsure the method is decorated with `@staticmethod` or `@classmethod` if it's meant to be called on the class.rR   )builderr}  r   is_callable_allowedrA  rD  r   create_proxyr   rq  rx  rY   r   rf  getattr_staticr   r   r   __get__lookupcreate_with_sourcer   r   r	   r   r}   r   )
r@   rO   re   r   rA   r}  rB  rY   objr   s
             r5   r   $AutogradFunctionVariable.call_method  s    	+7?..t{{;;,MKK-) %))00'1 +48  r88Z%%b776:kk6MZT2SWF,,T[[$? #|,,{{4;;/%#**40++D+@&r8 '--d3D9GG&  C-- 33LL$-&12 !B*4&$8!v 9!9
U) " s   !G G! G!)rA  r   r   )rO   r*   r   r   rA   r   )r/   r0   r1   r2   r  r"   r   r=   rq  rx  r   r   r3   r   r   s   @r5   rG  rG    s\    7 			'	'N
||
5>#> &	>
 -> >r4   rG  c                   F    \ rS rSr% \R
                  " \S9r\\   \	S'   Sr
g)SavedTensorBoxi]  )default_factorytensorsr.   N)r/   r0   r1   r2   dataclassesfieldlistr  r"   r6  r3   r.   r4   r5   r  r  ]  s    %0%6%6t%LGT/"Lr4   r  c                      ^  \ rS rSrSrSSS1\R                  kr     S SU 4S jjjr\SSS jj5       r	S r
        SU 4S	 jjrSU 4S
 jjrSrU =r$ )re  ib  zR
Tracks an autograd.Function() context using mutation tracking in side_effects.py
r~  	inferencesaved_tensorsc                 Z   > [         TU ]  " SXS.UD6  X0l        X@l        XPl        X`l        g N)r\   r   r.   )r<   r=   r  r  needs_input_gradnon_differentiable)	r@   r\   r   r  r  r  r  rA   rB   s	           r5   r=   (AutogradFunctionContextVariable.__init__n  s1     	FuFvF"* 0"4r4   c                     S nU(       a  U(       d  [        S U 5       5      nU R                  R                  R                  S [        R
                  R                  R                  [        R                  " [        S[        5       US90 5      nU$ )Nc              3   |   #    U  H2  n[        U[        R                  5      =(       a    UR                  v   M4     g 7frF   )r   r	   rL  rM  .0xs     r5   	<genexpr>9AutogradFunctionContextVariable.create.<locals>.<genexpr>  s0      %A 1i667KAOOKs   :<T)r  r  r  )r+  r   r   track_object_newr   r^  functionFunctionCtx	functoolspartialre  r  )rO   r   rA   r  outs        r5   rt   &AutogradFunctionContextVariable.create~  s    $ %%   ii$$55NN##///,.!1	 

 
r4   c                 r    U R                   c  [        SSU  3S/ [        R                  QS9  U R                   $ )Nzproxy not setz	as_proxy zMDynamo requires the autograd.Function context to be initialized with a proxy.rR   )r~  r   r   r   r   s    r5   as_proxy(AutogradFunctionContextVariable.as_proxy  sA    ::'#D6*25)445 zzr4   c                   > US:X  a  [         TU ]  XX45      $ US:X  aD  [        U5      S:X  d   e[        U0 5      S   U l        [
        R                  R                  S 5      $ US:w  a&  [        SSU  SU 3SU S	3/ [        R                  QS
9  U R                  c  [        SSU  SU 3SS/S
9  U R                  (       d?  U R                  (       a  U(       a   eUR                  R                  R!                  X5        [        U R                  R"                  5      S:  a  / U R                  l        U H(  nU R                  R"                  R%                  U5        M*     [
        R                  R                  S 5      $ )Nr   mark_non_differentiabler   save_for_backwardz,Unsupported autograd.Function context methodry   rz   r  z` on `autograd.Function` context objects. Supported methods are `__setattr__`, `save_for_backward` and `mark_non_differentiable`.rR   z9Unsupported autograd.Function context `save_for_backward`zjDynamo requires the `saved_tensors` attribute to be initialized on the `autograd.Function` context object.zEnsure that the `saved_tensors` attribute is properly initialized before calling `save_for_backward`. `save_for_backward` only supported on a newly constructed `torch.autograd.function.FunctionCtx`.)r<   r   rb   r   r  r	   r#   rt   r   r   r   r  r  rY   r   r   track_save_for_backwardr  append)r@   rO   re   r   rA   argrB   s         r5   r   +AutogradFunctionContextVariable.call_method  s|    = 7&r>>..v;!###&7b&A!&DD#--44T::&&F&tfAdV46 -- 7)556 %S&tfAdV4Ow
 ~~;;v--II""::4F t!!))*Q.)+D&C&&--c2 ))0066r4   c                   >^ ^^ TS;   a  [        UU U4S j5      $ TS:X  a@  T R                  b3  [        R                  " [	        T R                  R
                  5      5      $ TS:X  a  T R                  b)  [        R                  R                  T R                  5      $ T R                  (       aB  [        T R                  S5      n[        R                  " TT R                  R                  U5      $ [        TT ]=  TT5      $ )N)r  r  c                  *   > TR                  TTX5      $ rF   )r   )r   rA   re   r@   rO   s     r5   rI   =AutogradFunctionContextVariable.var_getattr.<locals>.<lambda>  s    (8(8T4(Pr4   r  r  )r   r  r	   TupleVariabler  r  r  r#   rt   rY   r   r"   r   r\   r<   ru   r@   rO   re   rY   rB   s   ``` r5   ru   +AutogradFunctionContextVariable.var_getattr  s    CC!P  ?"t'9'9'E**40B0B0J0J+KLL%%$$0 11889N9NOO{{#DKK1CD&,,R1L1LfUUw"2t,,r4   )r  r  r  r  )NFNNNr   NNr   r   )r/   r0   r1   r2   r  r(   r   r=   r   rt   r  r   ru   r3   r   r   s   @r5   re  re  b  s    
 	 
#	1	1	N 5 
5 5   (	.7#.7 &	.7
 -.7 
.7`- -r4   re  c                   R   ^  \ rS rSrSr S SU 4S jjjr        SS jrSrU =r$ )	AutogradEngineVariablei  z3
Represents a torch._C._ImperativeEngine instance.
c                 *   > [         TU ]  " SXS.UD6  g r  r:  )r@   r\   r   rA   rB   s       r5   r=   AutogradEngineVariable.__init__  s     	FuFvFr4   c                 
   US:X  a  [         R                  R                  R                  (       a  UR                  (       d  UR
                  (       d   S5       e[        R                  " [         R                  R                  R                  R                  U R                  S9R                  UUR                  R                  R                  5       /UQ7U5      $ [!        SSU  SU 3S/ S9  g [!        S	SU  SU 3S
U S3/ S9  g )Nqueue_callbackzXqueue_callback() is only supported when Compiled Autograd is enabled with fullgraph=Truero   z7Unsupported torch._C._ImperativeEngine.queue_callback()ry   rz   zYqueue_callback() is only supported when Compiled Autograd is enabled with fullgraph=True.rR   z-Unsupported torch._C._ImperativeEngine methodzgDynamo only supports the `queue_callback` method on a torch._C._ImperativeEngine instance, but found: `z`.)r   rt  compiled_autogradin_compiled_autograd_region	one_grapherror_on_graph_breakr	   r%   ru  FakeCompiledAutogradEnginer  rY   r   r   r   get_ca_final_callbacks_varr   r@   rO   re   r   rA   s        r5   r   "AutogradEngineVariable.call_method  s     ##}}..JJ||r'>'> n> !55MM00KKZZ;;  -YY++FFHP4P !U*4&$8!H G&tfAdV4IIMbRr4   r.   rF   r   r   	r/   r0   r1   r2   r  r=   r   r3   r   r   s   @r5   r  r    sT     G
 
G G### &	#
 -# 
# #r4   r  c                   F   ^  \ rS rSrSU 4S jjr        SS jrSrU =r$ )r   i  c                 2   > [         TU ]  " S0 UD6  Xl        g r;   )r<   r=   r-  )r@   r-  rA   rB   s      r5   r=   LambdaVariable.__init__  s    "6"r4   c                 &    U R                   " U0 UD6$ rF   r-  r  s       r5   r   LambdaVariable.call_function  s     ww'''r4   r  r   r   )r/   r0   r1   r2   r=   r   r3   r   r   s   @r5   r   r     s8    (#( &( -	(
 
( (r4   r   c                     ^  \ rS rSrSS1\R
                  krSSU 4S jjjrU 4S jrS\4S jr	\
S\R                  R                  4S	 j5       rS
 rS rSS jrSS jr        SS jrSSS\\   S\\\4   S\4U 4S jjrS rSrU =r$ )rq   i   re   py_typer9   c                    > [         TU ]  " S0 UD6  [        U[        5      (       d   e[        U[        5      (       d   eXl        X l        X0l        g r;   )r<   r=   r   r"   r   r  re   r  )r@   r  re   r  rA   rB   s        r5   r=   GetAttrVariable.__init__'  sH    "6"#////$$$$$	r4   c                 R   > U R                   b  U R                   $ [        TU ]	  5       $ rF   )r  r<   rX   r@   rB   s    r5   rX   GetAttrVariable.python_type/  s%    <<#<<7&((r4   c                 h    U R                   R                   SU R                   SU R                   S3$ Nr  z, r	  )rB   r/   r  re   r   s    r5   r  GetAttrVariable.__repr__5  s.    ..))*!DHH:R		{!DDr4   
base_proxyc                     [        X5      $ rF   )r`   )r  r   s     r5   create_getattr_proxy$GetAttrVariable.create_getattr_proxy8  s    z((r4   c                 r    [         R                  U R                  R                  5       U R                  5      $ rF   )rq   r  r  r  re   r   s    r5   r  GetAttrVariable.as_proxy<  s&    33DHH4E4E4GSSr4   c                     U R                   R                  5       n [        XR                  5      $ ! [         a    [        U  S35      S ef = f)Nz is not a constant)r  rW   r`   re   r   r   )r@   constants     r5   rW   "GetAttrVariable.as_python_constant?  sO    88..0	M8YY// 	M%.@&ABL	Ms	   1 ArO   r*   c                    [        U R                  [        R                  5      (       d  [        eUR
                  R                  U R                  R                  5      nU R                  UR                  ;  a  [        e[        R                  " X0R                  5      nX$R                  ;  a  [        e[        R                  " XB5      $ rF   )r   r  r	   rN  r   r   get_submodule
module_keyre   rc   rf  r  )r@   rO   re   step1step2s        r5   const_getattrGetAttrVariable.const_getattrF  s    $((I$>$>??%%		''(;(;<99ENN*%%&&uii8~~%%%%%e22r4   c                 |    U" U R                   5        UR                  UR                  U R                  5      5        g rF   )r  rL   create_load_attrsre   r  s     r5   rM   GetAttrVariable.reconstructQ  s+    g77		BCr4   r   rA   c                 N    U R                   R                  XR                  X#5      $ rF   )r  r   re   r  s       r5   r   GetAttrVariable.call_functionU  s     xx##B		4@@r4   c                 >  > US;   a  U R                   S:X  a  U(       d  US   R                  5       (       a  [        U R                  [        R
                  [        R                  [        R                  45      (       ax  U R                  nUS   R                  5       nUR                  X5      (       a  UR                  X5      $ US:X  a*  [        U5      S:X  a  US   $ [        R                  " S 5      $ GOUS:X  a  U R                   S:X  a  [        U5      S:X  a  US   R                  5       (       a  U(       d  [        U R                  [        R
                  [        R                  [        R                  45      (       aa  U R                  nUS   R                  5       nUR                  X5      (       a  [        R                  " S5      $ [        R                  " S	5      $ US
:X  a  U R                   S:X  a  U(       d  [        U R                  [        R
                  5      (       a!  U R                  R                  XS   US   SS9$ [        U R                  [        R                  5      (       a  U R                  R                  U5        [        TU ]A  XX45      $ )N)__getitem__rd   rc   r   rd   r   r!   __contains__TF__setitem__)directly_update_dict)re   is_python_constantr   r  r	   r(   rN  r   rW   has_key_in_generic_dictru   rb   r#   r   convert_to_unspecializedr<   r   )r@   rO   re   r   rA   r  keyrB   s          r5   r   GetAttrVariable.call_method]  s#    **		Z'Q**,,77..66  ((Cq',,.C**233r// u}t9>7N$55d;;	  N"		Z'D	QQ**,,77..66  ((Cq',,.C**233 11$77 11%88]"tyyJ'>v$((I$G$GHHxx77Qat 8   $((I$>$>??11"5w"2T::r4   c                    U R                   S:X  a]  [        U R                  [        R                  5      (       a4  UR
                  R                  R                  U R                  5      (       a   eSU R                  l        [        R                  " XR                  R                  R                  U R                  5      $ )Nrc   T)re   r   r  r	   r   r   r   has_pending_mutationban_mutationr"   r   r\   rc   rY   )r@   rO   s     r5   get_forwarded_dict"GetAttrVariable.get_forwarded_dict  s    II#488Y%G%GHHII**??II	
J !%$$R)@)@$++NNr4   )re   r  r  rF   r   r   r   r   )r/   r0   r1   r2   r"   r   r=   rX   r   r  r   r   fxProxyr  r  rW   r  rM   r   r  dictr   r  r3   r   r   s   @r5   rq   rq      s     
	'	'N )E# E ) ) )TM	3DA#A &A -	A
 
AB;#B; ?#	B;
 S/)*B; 
B;HO Or4   rq   c                   X   ^  \ rS rSrSU 4S jjr        SU 4S jjrS rS rSrU =r	$ )	MethodWrapperVariablei  c                 @   > [         TU ]  " S0 UD6  Xl        0 U l        g r;   )r<   r=   method_wrapper_builtin_fns)r@   r   rA   rB   s      r5   r=   MethodWrapperVariable.__init__  s!    "6",r4   c                 P  > [        U R                  5      (       at  [        US   [        R                  5      (       aR  [        U5      S:X  a  [        U5      S:X  d   eUS   R                  XR                  R                  R                  5      $ U R                  R                  nU R                  R                  nUS:X  aV  [        U5      R                  nU[        R                  L a.  [        R                  " [        5      R                  XU/UQU5      $ [        TU ]=  XU5      $ )Nr   r!   r=   )r   r   r   r	   rL  rb   ru   r   r/   r[   r=   r   rG   r   r<   r   )r@   rO   r   rA   self_objwrapper_namefn_objrB   s          r5   r   #MethodWrapperVariable.call_function  s    &d&9&9::zGY--@
 @
 t9>c&kQ&6667&&r+>+>+G+G+P+PQQ &&//**33 :%(^,,F( 008DDx&7$&7  w$Rv66r4   c                     gNTr.   r   s    r5   r  (MethodWrapperVariable.is_python_constant      r4   c                     U R                   $ rF   )r   r   s    r5   rW   (MethodWrapperVariable.as_python_constant  s    """r4   )r  r   r   r   )
r/   r0   r1   r2   r=   r   r  rW   r3   r   r   s   @r5   r  r    sB    
7#7 &7 -	7
 
7># #r4   r  c                   H   ^  \ rS rSrSU 4S jjrSU 4S jjrS rS rSrU =r	$ )	GetSetDescriptorVariablei  c                 2   > [         TU ]  " S0 UD6  Xl        g r;   )r<   r=   desc)r@   r  rA   rB   s      r5   r=   !GetSetDescriptorVariable.__init__  s    "6"	r4   c                    > US:X  aR  U R                   (       aA  [        U R                   S5      n[        R                  " XR                  R
                  U5      $ [        TU ]  X5      $ )Nr  )rY   r   r"   r   r  r  r<   ru   r  s       r5   ru   $GetSetDescriptorVariable.var_getattr  sN    9Y7F"((YY->->GG7&r00r4   c                     gr	  r.   r   s    r5   r  +GetSetDescriptorVariable.is_python_constant  r  r4   c                     U R                   $ rF   r  r   s    r5   rW   +GetSetDescriptorVariable.as_python_constant  s    yyr4   r  r   r   )
r/   r0   r1   r2   r=   ru   r  rW   r3   r   r   s   @r5   r  r    s    1 r4   r  c                      ^  \ rS rSrSS1\R
                  krS\R                  SS4U 4S jjrS r	S r
S\4S	 jrSS
 jrSS jrSrU =r$ )PythonModuleVariablei  r\   is_torchr9   Nc                    > [         TU ]  " S0 UD6  Xl        U R                  [        L =(       d%    U R                  R                  R                  S5      U l        g )Nztorch.r.   )r<   r=   r\   r   r/   
startswithr  r@   r\   rA   rB   s      r5   r=   PythonModuleVariable.__init__  sB    "6"


e+Wtzz/B/B/M/Mh/Wr4   c                 "    [         R                  $ rF   )r   
ModuleTyper   s    r5   rX    PythonModuleVariable.python_type  s    r4   c                     U R                   $ rF   r\   r   s    r5   rW   'PythonModuleVariable.as_python_constant      zzr4   c                 "    SU R                    S3$ )NzPythonModuleVariable(r	  r%  r   s    r5   r  PythonModuleVariable.__repr__  s    &tzzl!44r4   c                 l    [        U R                  U5      n[        R                  R	                  U5      $ rF   )r   r\   r	   r#   rt   r@   rO   re   r   s       r5   call_obj_hasattr%PythonModuleVariable.call_obj_hasattr  s)    T*))0088r4   c                    UR                   R                  R                  X5      (       a%  UR                   R                  R                  X5      $ U R                  (       d  X R
                  R                  ;  a   [        U R
                  U5      nOU R
                  R                  U   nU R                  =(       a    [        U R                  U5      n[        R                  " UWU5      $ ! [         a    [        [        U5         N]f = frF   )r   r   r   r   r  r\   rc   r`   r   r   rY   r   r"   r   )r@   rO   re   r   rY   s        r5   ru    PythonModuleVariable.var_getattr  s    99!!>>tJJ99))33D??==D

(;(;;=$TZZ6
 ,,T2J>DKK!>$$RV<< " =(<=s   ;C, ,D	D	)r  r\   r   )r/   r0   r1   r2   r"   r   r   r"  r=   rX   rW   r   r  r,  ru   r3   r   r   s   @r5   r  r    sa     
	'	'NXe.. XT X
 5# 59= =r4   r  c                   h   ^  \ rS rSrSU 4S jjr        SS jrSSS\4S jrS rSS	 jr	S
r
U =r$ )TypingVariablei  c                 2   > [         TU ]  " S0 UD6  Xl        g r;   r<   r=   r\   r  s      r5   r=   TypingVariable.__init__      "6"
r4   rO   r*   c                     US:X  a:  [        U5      S:X  a+  U R                  US   R                  5          n[        U5      $ [	        S5        g )Nr  r!   r   z+unsupported method call on typing variablel)rb   r\   rW   r1  r   )r@   rO   re   r   rA   
new_typings         r5   r   TypingVariable.call_method  sE     = SY!^DG$>$>$@AJ!*--CDr4   re   c                    SSK JnJn  U[        ;   a  [        R
                  " X5      $ UR                  R                  R                  X5      (       a  UR                  R                  X5      $ [        U R                  U5      nU R                  (       a$  [        U R                  U5      nU" X5      " U5      $ UR                  X5      $ )Nr!   )SourcelessBuilderVariableBuilder)r  r:  r;  r   r	   rq   r   r   r   r   r`   r\   rY   r   rt   )r@   rO   re   r:  r;  r\   r   s          r5   ru   TypingVariable.var_getattr%  s    ?)),,T8899!!>>tJJ??,,T88

D);;$T[[$7K"23E::$++B66r4   c                     U R                   $ rF   r%  r   s    r5   rW   !TypingVariable.as_python_constant5  r'  r4   c                 X    UR                  UR                  U R                  5      5        g rF   )append_outputcreate_load_constr\   r  s     r5   rM   TypingVariable.reconstruct8  s!    0 	g77

CDr4   r%  r   r   )rH   r)   r9   N)r/   r0   r1   r2   r=   r   r   ru   rW   rM   r3   r   r   s   @r5   r1  r1    s]    E#E &	E
 -E 
E75 7S 7 E Er4   r1  )maxsizec                      SSK Jn   0 nU R                  5        HS  u  p#UR                  R                  5        H0  u  pE[	        U5      (       d  M  [        X$S5      =n(       d  M,  XQU'   M2     MU     U$ )zX
This generates a mapping from numpy modules to their torch._numpy
modules equivalents.
r   )NP_TO_TNP_MODULEN)utilsrE  r   rc   callabler`   )rE  np_fn_to_tnp_fnnp_modtnp_modr)  tnp_fnnp_fns          r5   get_np_to_tnp_maprM  S  sk     )O+113&//557OG $FT::5:-3E*  8 4 r4   c                  l    [        5       n U R                  5        VVs0 s H  u  pX!_M	     snn$ s  snnf )zs
This is just the reverse mapping of get_np_to_tnp_map() - mapping from
torch._numpy modules to numpy equivalents.
)rM  r   )mkvs      r5   get_tnp_to_np_maprR  h  s.     	AWWY'YTQADY'''s   0c                      ^  \ rS rSrSr\R                  4rSU 4S jjr\	S 5       r
\	S 5       r        SS jr        SS jrS rU 4S	 jrS
rU =r$ )NumpyVariableir  zr
Wrapper around `numpy.*`. Currently, is able to trace a small subset of numpy functions as well as numpy dtypes.
c                 2   > [         TU ]  " S0 UD6  Xl        g r;   r3  r  s      r5   r=   NumpyVariable.__init__y  r5  r4   c                     UR                   R                  S5      n[        U5      S:  a  US S SS/:X  d   eXR                  ;   $ N.r   r   _numpy)r0   splitrb   constant_fold_functionsclsr-  mods      r5   can_constant_fold_through'NumpyVariable.can_constant_fold_through}  sH    mm!!#&3x1}RaWh,?!???0000r4   c                     UR                   R                  S5      n[        U5      S:  a  US S SS/:X  d   e[        R	                  US 5      $ rX  )r0   r[  rb   np_constant_collections_maprd   r]  s      r5    get_constant_collection_for_func.NumpyVariable.get_constant_collection_for_func  sL    mm!!#&3x1}RaWh,?!???*..r488r4   c                 <   [         R                  (       d  [        SU R                   S35        SSKJn  SSKJn  [        5       R                  U R                  5      nUc  [        SU R                   S35        U R                  U5      =n bh   U" U R                  " U Vs/ s H  oR                  5       PM     sn0 UR                  5        V	V
s0 s H  u  pXR                  5       _M     sn
n	D65      $ UR                  S:X  aF  [         R                   (       a1  SUR"                   S3nUS[         R                    3-  n[        U5        UR%                  UR                  X#5      u  p#U R'                  U5      (       a  [)        X#5      (       a  [*        R,                  R/                  U R                  5       " U Vs/ s H  oR                  5       PM     sn0 UR                  5        V	V
s0 s H  u  pXR                  5       _M     sn
n	D65      $ UR0                  R2                  " SU" U5      /[5        X#5      Q76 nUR/                  X5      $ s  snf s  sn
n	f ! [         a*    [        U R                  R                   S	U S
U 35         g f = fs  snf s  sn
n	f )Nznumpy.z()r   )numpy_to_tensor_wrapperr!   )NumpyNdarrayVariablezCan't find numpy function zM in torch._numpy.  Please file an issue to request support for this function.z with non-const args: rz   ztorch._numpy.randomz
delegate 'z' to NumPy itself via zconfig.use_numpy_random_stream=r   )r   trace_numpyr   r\   rF  rg  tensorrh  rM  rd   rd  rW   r   r   r/   r0   use_numpy_random_streamr1   
patch_argsr`  r   r	   r#   rt   r   r  r   )r@   rO   r   rA   rg  rh  r   collection_variable_typr  rP  rQ  r   r~  s                r5   r   NumpyVariable.call_function  sh    !!F4::,b1230 "&&tzz2<,TZZL 9N N (,'L'LT'RR#
.JJ:>?$Q..0$?AGP12244P  #8822"4#4#4"55KL5f6T6T5UV c"/::4==$WLD--d33-d;; !1188++-:>?$Q..0$?AGP12244P  II**'- #40E
 (..r99M @P ' zz**++A$qQ. @Ps<   I "I;I I-	I >J-JI 1JJc                     [        S5        g )Nnumpy)r   r  s        r5   r   NumpyVariable.call_method  s     	gr4   c                     U R                   $ rF   r%  r   s    r5   rW    NumpyVariable.as_python_constant  r'  r4   c                    > [         R                  (       a5  [        U R                  [        5      (       a  U R                  R
                  $ [        TU ]  5       $ rF   )r   ri  r   r\   r[   r/   r<   r  r  s    r5   r  NumpyVariable.as_proxy  s<    *TZZ">"> ::&&&w!!r4   r%  r   r   )r/   r0   r1   r2   r  tnp
issubdtyper\  r=   r   r`  rd  r   r   rW   r  r3   r   r   s   @r5   rT  rT  r  s      #~~/ 1 1
 9 9
@:#@: &@: -	@:
 
@:D# &	
 - 
" "r4   rT  c                   D   ^  \ rS rSrSU 4S jjrS\4S jrSS jrSrU =r	$ )	NullVariablei  r9   c                 &   > [         TU ]  " S0 UD6  g r;   r:  r;  s     r5   r=   NullVariable.__init__  r=  r4   c                     g)Nry  r.   r   s    r5   r  NullVariable.__repr__  s    r4   c                 v    [         R                  S:  a  [        S5        UR                  [	        S5      5        g )N)r      z0cannot reconstruct NullVariable in < Python 3.11	PUSH_NULL)sysversion_infor   r@  r   r  s     r5   rM   NullVariable.reconstruct  s-    g%LM0=>r4   r.   r   r   )
r/   r0   r1   r2   r=   r   r  rM   r3   r   r   s   @r5   ry  ry    s    ## ? ?r4   ry  c                       \ rS rSrSrSrg)r   i  z"Marker used to implement delattr()r.   Nr  r.   r4   r5   r   r     s    ,r4   r   c                   v   ^  \ rS rSrSrS1\R                  kr\S 5       rS
U 4S jjr	S\
4S jrSS jrS	rU =r$ )StringFormatVariablei  zS
Represents a call to str.format(), we delay calling format until after the graph.
format_stringc                    [        S [        R                  " X#R                  5       5       5       5      (       a~  [        R
                  R                  UR                  " U Vs/ s H  oDR                  5       PM     sn0 UR                  5        VVs0 s H  u  pTXTR                  5       _M     snnD65      $ U " U[        U5      [        U5      5      $ s  snf s  snnf )Nc              3   B   #    U  H  nUR                  5       v   M     g 7frF   )r  r  s     r5   r  .StringFormatVariable.create.<locals>.<genexpr>  s#      
C   ""Cs   )all	itertoolschainvaluesr	   r#   rt   formatrW   r   r  r  )r^  r  sym_args
sym_kwargsrQ  rP  s         r5   rt   StringFormatVariable.create  s     
__X/@/@/BC
 
 
 --44$$6>?h**,h?=G=M=M=OP=OTQq..00=OP  =$x.$z2BCC	 @Ps   #CCr9   c                 x   > [         TU ]  " S0 UD6  [        U[        5      (       d   eXl        X l        X0l        g r;   )r<   r=   r   r   r  r  r  )r@   r  r  r  rA   rB   s        r5   r=   StringFormatVariable.__init__  s6    "6"-----* $r4   c                     U R                   R                   SU R                  < SU R                  < SU R                  < S3$ r  )rB   r/   r  r  r  r   s    r5   r  StringFormatVariable.__repr__  sB    ..))*!D,>,>+ADMMCTTVW[WfWfViijkkr4   c                   ^ ^ TR                  UU 4S jSS9  T" [        R                  " T R                  5      5        T R                  R                  5        VVs0 s H%  u  p#[        R                  R                  U5      U_M'     nnnT" [        R                  " U5      5        TR                  [        SSS95        g s  snnf )Nc                  z   > T R                  T R                  TR                  5      T R                  S5      /5      $ )Nr  )rL   rA  r  create_load_attrr   s   r5   rI   2StringFormatVariable.reconstruct.<locals>.<lambda>  s7    G))--d.@.@A,,X6r4   T)call_function_exCALL_FUNCTION_EXr!   )r  )rK   r	   r  r  r  r   r#   rt   ConstDictVariabler@  r   )r@   rH   rP  rQ  rA   s   ``   r5   rM    StringFormatVariable.reconstruct  s     " 	 	
 		''67@D@U@U@W
@WI&&--a0!3@W 	 
 		++F3401CKL	
s   ,C )r  r  r  r   r   )r/   r0   r1   r2   r  r"   r   r   rt   r=   r   r  rM   r3   r   r   s   @r5   r  r    sP     &G(F(FGND D%l# lM Mr4   r  c                   h   ^  \ rS rSrSrS	U 4S jjr\S 5       rS
S jrSS jr	\SS j5       r
SrU =r$ )DebuggingVariablei$  zz
Represents a call to a debugging function like print(), or something
registered to config.reorderable_logging_functions.
c                 2   > [         TU ]  " S0 UD6  Xl        g r;   r3  r  s      r5   r=   DebuggingVariable.__init__*  r5  r4   c                     [        U 5      =(       aX    [        U [        R                  [        R                  45      =(       a'    U [
        R                  R                  R                  ;   $ rF   )	rG  r   r   r   BuiltinFunctionTyper   rt  r   reorderable_logging_functions)r  s    r5   is_reorderable_logging_function1DebuggingVariable.is_reorderable_logging_function.  sO     SM J3!3!3U5N5N OPJu}}++III	
r4   c           	          UR                   (       a  g U R                  U R                  X#5      (       d  [        SU R                   SU SU S35        UR                  R                  U [        U5      45        g )NzReordering debugging function z with inputs rz   z is not yet implemented.)exportcan_reorder_logsr\   r   debug_localsr  r  r  s       r5   r   DebuggingVariable.call_function6  sl    99$$TZZ>>0 =#fAfX-EG
 	d4j12r4   c                 8    U R                   R                  U5      $ rF   )rY   rM   r  s     r5   rM   DebuggingVariable.reconstructC  s    {{&&w//r4   c                     [         R                  [         R                  [        4n[        R
                  " X/5      nU H  n[        XS5      (       a  M    g   g)zU
Run some additional checks for what sort of function calls can we
actually reorder.
FT)r	   rL  r#   r  pytreetree_leavesr   )r-  r   rA   allowed_input_types	flat_argsr  s         r5   r  "DebuggingVariable.can_reorder_logsF  sR     $$&& 
 &&~6	Cc77  r4   r%  r   r   r   )r9   T)r/   r0   r1   r2   r  r=   r   r  r   rM   r  r3   r   r   s   @r5   r  r  $  s?    
 
 
30  r4   r  c                   J   ^  \ rS rSrSrSU 4S jjr        SS jrSrU =r$ )LoggingLoggerVariablei[  z4
Represents a call to any of logging.Logger methods
c                 2   > [         TU ]  " S0 UD6  Xl        g r;   r3  r  s      r5   r=   LoggingLoggerVariable.__init__`  r5  r4   c                 6   UR                   (       a  g [        U R                  US 5      n[        USS 5      nXV1R                  [        R
                  R                  R                  5      (       a  [        R                  R                  S 5      $ [        S5        g )Nr}   zLogger not supported for non-export cases. To avoid graph breaks caused by logger in compile-mode, it is recommended to disable logging by adding logging methods to config.ignore_logger_methods)r  r`   r\   intersectionr   rt  r   ignore_logger_methodsr	   r#   rt   r   )r@   rO   re   r   rA   methodr  s          r5   r   !LoggingLoggerVariable.call_methodd  sw     99T406:t4**5==+?+?+U+UVV--44T::Y	
r4   r%  r   r   r  r   s   @r5   r  r  [  s=    
#
 &	

 -
 

 
r4   r  c                      ^  \ rS rSrSrS r SSKJrJ	r
Jr  SU 4S jjrS	 rS
SS\\   S\\\4   S\4S jrS
SS\S\4S jrSrU =r$ ! \ a    \" SS0 5      r
\" SS0 5      r NMf = f)ConstantLikeVariableiy  z8self.value is a compile-time constant, but not a literalr   )dtypefloatinggenericinvalid_typer.   r9   c                 2   > [         TU ]  " S0 UD6  Xl        g r;   r3  r  s      r5   r=   ConstantLikeVariable.__init__  r5  r4   c                     U R                   $ rF   r%  r   s    r5   rW   'ConstantLikeVariable.as_python_constant  r'  r4   rO   r*   r   rA   c                 l    U Vs/ s H  oUR                  5       PM     nnUR                  5        VVs0 s H  u  pxXxR                  5       _M     n	nn[        U R                  U5      " W0 W	D6n
[        R                  R                  U
5      (       a  [        R                  R                  U
5      $ [        U
[        R                  5      (       a  [        U
5      $ [        U R                   SU SU
 35        g s  snf s  snnf ! [         a$    [        U R                   SU SU SU S35         Nf = f)NrY  z(*z, **r	  z() -> )rW   r   r   r   _error_prefixr`   r\   r	   r#   rp   rt   r   reMatchConstantRegexMatchVariable)r@   rO   re   r   rA   r  cargsrP  rQ  ckwargsr   s              r5   r    ConstantLikeVariable.call_method  s   	O59:T))+TE:=C\\^L^TQq..00^GL T*E=W=%%0088--44V<<fbhh''-f55++,AdV6&BC ;L" 	OT//0$r$tF81MN	Os,   D C:D C?D :D +D32D3re   c                    [        U R                  U5      n[        X0R                  5      (       a  [	        U5      n[        X0R
                  5      (       a  [        U5      $ [        U[        5      (       a%  [        X0R                  5      (       a  [        U5      $ [        R                  R                  U5      (       a  [        R                  R                  U5      $ [        X5      $ rF   )r`   r\   r   np_floatingfloatnp_dtypeNumpyDTypeVariabler[   rZ   
np_genericrT  r	   r#   rp   rt   rq   r+  s       r5   ru    ConstantLikeVariable.var_getattr  s    T*f..//6]Ffmm,,%f--fd##
6??(K(K ((%%0088--44V<<t**r4   r%  r   )r/   r0   r1   r2   r  r  rp  r  r  r  r  r  r  ImportErrorr[   r=   rW   r  r"   r  r   r   ru   r3   r   r   s   @r5   r  r  y  s    B*M0	
 	
D#D ?#	D
 S/)*D 
D.+5 +S +_ + +E  0>2r2B/0s   
A A%$A%r  c                       \ rS rSrSrSrg)RegexPatternVariablei  z
re.Patternr.   Nr/   r0   r1   r2   r  r3   r.   r4   r5   r  r    s     Mr4   r  c                       \ rS rSrSrSrg)r  i  zre.Matchr.   Nr  r.   r4   r5   r  r    s    Mr4   r  c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )TorchVersionVariablei  ztorch.__version__c                    > UR                  S[        R                  5        US   [        R                  L d   e[        TU ]  " S0 UD6  g )Nr\   r.   )
setdefaultr   __version__r<   r=   r;  s     r5   r=   TorchVersionVariable.__init__  sA    '5#4#45g%"3"3333"6"r4   r.   r   )r/   r0   r1   r2   r  r=   r3   r   r   s   @r5   r  r    s    'M# #r4   r  c                       \ rS rSrSrSrg)NumpyTypeInfoVariablei  znp.iinfo/np.finfor.   Nr  r.   r4   r5   r  r    s    'Mr4   r  c                       \ rS rSrSrS rSrg)r  i  znp.dtype[...]c                 B    U R                   R                  R                  $ )a  Similar to how numpy dtype descriptors (e.g. np.float32 ) are handled by NumpyVariable:

np.dtype() objects are serialized as strings, torch._numpy wrappers will normalize to the torch dtype.
This also handles unsupported things nicely (i.e. structured arrays and object arrays).
)r\   r[   r/   r   s    r5   r  NumpyDTypeVariable.as_proxy  s     zz'''r4   r.   N)r/   r0   r1   r2   r  r  r3   r.   r4   r5   r  r    s    #M(r4   r  c                   :   ^  \ rS rSrSrSU 4S jjrSS jrSrU =r$ )RandomClassVariablei  zrandom.Randomc                 &   > [         TU ]  " S0 UD6  g r;   r:  r;  s     r5   r=   RandomClassVariable.__init__  r=  r4   c                    [        U5      S:  a  [        S5        OU(       a  [        S5        [        U5      S:X  a  [        R                  R	                  S 5      OUS   n[        U[        R                  R                  5       S9$ )Nr!   zrandom.Random() with > 1 argzrandom.Random() with kwargsr   )seedr   )rb   r   r	   r#   rt   RandomVariablebaseValueMutationNew)r@   rO   r   rA   r  s        r5   r   !RandomClassVariable.call_function  sh    t9q=8978:=d)q.y))006dSTgY^^%D%D%F
 	
r4   r.   r   r   r  r   s   @r5   r  r    s    #
 
r4   r  c                     ^  \ rS rSrSrS1\R                  kr1 Skr  SS\\	R                     S\\   SS4U 4S	 jjjrS
 rS r\S 5       r\S 5       r\S 5       r\S 5       rSSS\\   S\\\4   S\4U 4S jjrSS jrSrU =r$ )r  i  zrandom.Random()

Implemented by wrapping a VariableTracker around a random.Random object.
The supported methods for the random.Random object cannot be overridden.
Assumes that random objects behave the same given a set seed or state.
random>   r  randintuniform	randrangeNrandr  r9   c                 D  > [         TU ]  " S0 UD6  Ub\  U R                  U5      (       d   e[        R                  " 5       U l        U R                  R                  UR                  5       5        g Ub  UR                  5       OS n[        R                  " U5      U l        g r;   )r<   r=   is_supported_random_objr  RandomsetstategetstaterW   )r@   r  r  rA   rB   s       r5   r=   RandomVariable.__init__   s|     	"6"//5555 --/DKKK  1040@4**,dD ---DKr4   c                 "    [         R                  $ rF   )r  r  r   s    r5   rX   RandomVariable.python_type  s    }}r4   c                     U R                   $ rF   r  r   s    r5   rW   !RandomVariable.as_python_constant  s    {{r4   c                    [        U 5      [        R                  La  g[        R                  " [
        R                  S5       H  n[        X5      (       d    g[        X5      n[        R                  " U5      (       a1  U[        [        R                  U5      R                  U 5      :w  a    gMl  [        USS 5      [        [        R                  U5      Ld  M    g   g)NF)r  r  r  r}   T)r[   r  r  r  r  r  _supported_fn_namesr   r`   rf  	isbuiltinr  )r   re   meths      r5   r  &RandomVariable.is_supported_random_obj  s    9FMM)OO..0P
D 3%%3%D  &&76==$7??DD  E 4T2'&--QU:VV 
 r4   c                     [        U 5      [        L d   e[        U S   5      [        L d   e[        U S   5      [        L d   e[        S U S    5       5      (       d   eU S   b  [        U S   5      [        L d   eg g )Nr   r!   c              3   D   #    U  H  n[        U5      [        L v   M     g 7frF   )r[   intr  s     r5   r  -RandomVariable.check_state.<locals>.<genexpr>-  s     48a47c>8s    r   )r[   r+  r	  r  r  )states    r5   check_stateRandomVariable.check_state(  s    E{e###E!H~$$$E!H~&&&45844444Qx4a>U#:::#:r4   c                 r   [         R                  U 5        [        R                  " [        R                  R                  U S   5      [        R                  " U S    Vs/ s H"  n[        R                  R                  U5      PM$     sn5      [        R                  R                  U S   5      /5      $ s  snf )Nr   r!   r   )r  r  r	   r  r#   rt   )r  r  s     r5   
wrap_stateRandomVariable.wrap_state0  s    ""5)&&**11%(;''CH8L8aY//66q98L **11%(;
 	
 Ms   )B4c                 P    U R                  5       n[        R                  U5        U$ rF   )rW   r  r  )r  	state_objs     r5   unwrap_stateRandomVariable.unwrap_state=  s$    ,,.	""9-r4   rO   r*   r   rA   c                   >^^ TS:X  a  UR                   R                  R                  U 5        U R                  R                  " U Vs/ s H  oUR                  5       PM     sn0 UR                  5        VVs0 s H  u  pgXgR                  5       _M     snnD6  [        R                  R                  S 5      $ TS:X  a)  U R                  U R                  R                  5       5      $ TS:X  aq  UR                   R                  R                  U 5        U R                  R                  U R                  US   5      5        [        R                  R                  S 5      $ TU R                  ;   a  UR                   R                  R                  U 5        U R                  R                  5       mUU4S jn[        U R                  T5      " U Vs/ s H  oUR                  5       PM     sn0 UR                  5        V	V
s0 s H  u  pXR                  5       _M     sn
n	D6  [!        XX45      $ ["        TU ]I  UTX45      $ s  snf s  snnf s  snf s  sn
n	f )Nr  r  r  r   c                  t   > [         R                  " 5       nUR                  T5        [        UT5      " U 0 UD6$ rF   )r  r  r  r`   )r   rA   rre   r  s      r5   call_random_meth4RandomVariable.call_method.<locals>.call_random_meth[  s1    MMO

5!q$'888r4   )r   r   mutationr  r  rW   r   r	   r#   rt   r  r  r  r  r  r`   r&   r<   r   )r@   rO   re   r   rA   r  r  r   r  rP  rQ  r  rB   s     `        @r5   r   RandomVariable.call_methodC  s    6>II""++D1KK267$Q&&($7AGPXS3..00P --44T::Z??4;;#7#7#9::ZII""++D1KK  !2!247!;<--44T::T---II""++D1KK((*E9 DKK&267$Q&&($79?H1**,,H
 ""EEw"2tT::7 8P* 8Hs   	H=8II>Ic                 8  ^ TR                  U4S j5        TR                  SS5        TR                  5         TR                  S5        T" U R	                  U R
                  R                  5       5      5        TR                  SS5        TR                  5         g )Nc                  n   > T R                  T R                  [        5      T R                  S5      /5      $ )Nr  )rL   create_load_python_moduler  r  rH   s   r5   rI   ,RandomVariable.reconstruct.<locals>.<lambda>l  s1    G))55f=,,X6r4   r   Fr  r!   T)rK   r   r   r   r  r  r  pop_topr  s    `r5   rM   RandomVariable.reconstructj  sz    	
 	a' 	*% 4 4 678a&r4   r   r  r   )r/   r0   r1   r2   r  r"   r   r  r   r  r  r=   rX   rW   r   r  r  r  r  r  r  r   r   rM   r3   r   r   s   @r5   r  r    s    			'	'N
 )-*..v}}%. '.
 
. .  $ ; ; 

 

  
%;#%; ?#	%;
 S/)*%; 
%;N r4   r  c                   \   ^  \ rS rSr\S 5       rU 4S jr        SS jrSS jrSr	U =r
$ )	WeakRefVariablei}  c                    UR                  SS 5      nUR                  nU=(       a    [        US5      n[        R                  " XU5      nU" 5       nU=(       a    [        U5      n[        R                  " XU5      nX2S'   [        X40 UD6$ )NrY   __callback__)rd   r&  r   r"   r   r   r$  )	rO   weakref_valueoptionsrY   callbackcallback_sourcecallback_vtreferentreferent_vts	            r5   r   WeakRefVariable.build~  s    Xt, -- GZ%G%++B/J ?5-f5%++B&A"{C7CCr4   c                 >   > [         TU ]  " S0 UD6  Xl        X l        g r;   )r<   r=   r-  r+  )r@   r-  r+  r(  rB   s       r5   r=   WeakRefVariable.__init__  s    #7#&&r4   c                     U R                   $ rF   )r-  r  s       r5   r   WeakRefVariable.call_function  s     r4   c                    ^ TR                  U4S j5        T" U R                  5        T" U R                  5        TR                  [	        SS5      5        g )Nc                  (   > T R                  SS5      $ )Nweakrefref)r   r  s   r5   rI   -WeakRefVariable.reconstruct.<locals>.<lambda>  s    g&>&>y%&Pr4   r   F)rK   r-  r+  rL   r
   r  s    `r5   rM   WeakRefVariable.reconstruct  sD    PQ  !  !21e<=r4   )r+  r-  r   r   )r/   r0   r1   r2   r   r   r=   r   rM   r3   r   r   s   @r5   r$  r$  }  sQ    	D 	D'
 #  &  -	 
 
 > >r4   r$  )qr  r  r  rf  r  r  r  r  r   rY  typingr   r   torch._Cr   torch._numpyrZ  rv  torch.utils._pytreerF  _pytreer  rQ   r   r   r   r	   bytecode_transformationr
   r   create_parameter_opr   r   r   r   r   guardsr   r   mutation_guardr   rY   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r  r"   r  r#   r   r$   r%   user_definedr&   r'   r(   torch._dynamo.codegenr)   torch._dynamo.symbolic_convertr*   r,   r7   r   r  r  r  r1  r8  rD  rG  	dataclassr  re  r  r   rq   r  r  r  r1  	lru_cacherM  rR  rT  ry  r   r  r  r  r  r  r  r  r  r  finfoiinfor  rc  r  r  r$  r.   r4   r5   <module>rI     s  "      	 
   *   $ $ @ @ N F K K 0 5 	 	 	 " & G X X /D	 	x
O x
v	A AHo 
o 
0:7 :7z;? ;(# #
%U Up M M Mz-&? z-z06 0f(_ (HOo HOV)#O )#X &&=? &=R=E_ =E@ Q  ( Q(  (l"O l"`
?? 
?-o -.M? .Mb4 4n
O 
<7+? 7+t!/ !!5 #/ #(0 (	(- 	( II$II$II! 
/ 
"N_ Nb>o >r4   