
    7h\#                    *   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.  SSKJ/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<J=r=  SSK>J?r?J@r@JArA  \(       a  SSKBJCrC  SSKDJErE   " S S5      rF " S S\85      rG " S S\85      rH " S S\85      rI " S S\I5      rJ " S S\85      rK " S  S!\85      rL " S" S#\85      rMS$ rN " S% S&\85      rO\R                   " S' S(5      5       rQ " S) S*\A5      rR " S+ S,\A5      rS " S- S.\85      rT " S/ S0\85      rU " S1 S2\85      rV " S3 S4\85      rW " S5 S6\85      rX " S7 S8\85      rY\R                  " SS99S: 5       r[\R                  " SS99S; 5       r\ " S< S=\85      r] " S> S?\85      r^ " S@ SA\85      r_ " SB SC\85      r` " SD SE\85      ra " SF SG\85      rb " SH SI\85      rc " SJ SK\c5      rd " SL SM\c5      re " SN SO\c5      rf " SP SQ\c5      rg " SR SS\c5      rh\R                  \g\R                  \g\R                  \h0rl " ST SU\85      rm " SV SW\85      rn " SX SY\85      rog)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
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_SUBOBJE    N)__name__
__module____qualname____firstlineno____static_attributes__r-       V/var/www/fran/franai/venv/lib/python3.13/site-packages/torch/_dynamo/variables/misc.pyr+   r+   E   s    r3   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$ )SuperVariableI   returnc                 >   > [         TU ]  " S0 UD6  Xl        X l        g Nr-   )super__init__typevarobjvar)selfr=   r>   kwargs	__class__s       r4   r<   SuperVariable.__init__N   s!    "6" 
 r3   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;   )rA   codegens   r4   <lambda>+SuperVariable.reconstruct.<locals>.<lambda>[   s    gi.G.G.N&Or3   r   Fr    )add_push_nullr=   r>   extend_outputr
   )r?   rG   rA   s    `r4   reconstructSuperVariable.reconstructZ   s`    OP;;"DKK !!"6q%"@A!!"6q%"@Ar3   txr)   c                 |  > 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       Hc  n	Xy   R                   R#                  U[$        5      =n
(       d  M.  U
[$        Ld  M9  U(       a   ['        [)        ['        US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    __mro__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valuerP   index
ValueErrorgetattrr;   rangelen__dict__getr+   r   r   r   )r?   rN   namesearch_typetype_to_usetype_to_use_sourcerY   
search_mrostart_indexr]   resolved_getattrrA   s              r4   _resolved_getattr_and_source*SuperVariable._resolved_getattr_and_sourcec   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)!+) *+=y I5 !	" ,33 9 	5<TF C((,~^DKK= QDD C:
	
+  	H 5:DA4GG	Hs   F !F;:F;rd   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   )
rk   r	   r"   
is_literalGetAttrVariabler   
make_guardr   CONSTANT_MATCHcreate)r?   rN   rd   r\   rY   s        r4   var_getattrSuperVariable.var_getattr   sn     99$E))44U;;"4..&++L,G,GHI))000FFr3   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OU 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      (       a  [        URB                  [D        RF                  5      (       a  [        U R                  [        R2                  5      (       a  U R                  nOhS nU R                  R,                  (       a   [K        U R                  R,                  S5      n[L        RN                  " XR                  RP                  U5      n[        RR                  " URB                  XS9R%                  XU5      $ [        U[D        RF                  5      (       a2  [        R                   " XVS9R%                  XR                  /U-   U5      $ [        U[D        RT                  5      (       a:  [        RR                  " URB                  U R                  US9R%                  XU5      $ [W        U5      (       a?  [        U R                  [        5      (       a   U R                  RX                  " U/UQ70 UD6$ U[        RZ                  L a  US   n UR]                  5       nUR`                  R                  Rc                  U R                  5      (       d1  ['        SSU  SU 3SU R                   S3S/[(        Rd                  QS	9  UR`                  R                  Rg                  U R                  U[        Rh                  " 5       5        [        Rj                  " S 5      $ [        U R                  [        Rl                  5      (       a?  XPR                  Rn                  ;   a&  U R                  Rp                  R?                  XX45      $ [        U R                  [        Rr                  5      (       a0  U[t        ;   a&  U R                  Rv                  R?                  XX45      $ [        U R                  [        Rx                  5      (       a0  U[z        ;   a&  U R                  R|                  R?                  XX45      $ U[        R~                  L Ga   US   R                  nUR`                  R                  R                  U R                  U5      (       a`  UR`                  R                  R                  U R                  USS9n[        U[        Rh                  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                  lK         UR%                  UUU5      UUR                  lK        $ [        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                  lK        f = f)!Nr   )AttributeMutationNewrn   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__r/   builtinsrA   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.)Ork   objectr<   LambdaVariabler   torchnnModuler>   side_effectsrw   
isinstancer	   r'   mutation_typer   r$   r   call_functionr   r   	DIFFICULTrY   hasattrr.   UserDefinedClassVariableis_supported_new_method__self__r/   rF   membercall_methodstaticmethod__func__typesFunctionTypeclassmethodr   r!   build
value_typeUserMethodVariable
MethodTyper&   method_setattr_standard__delattr__rW   NotImplementedErroroutputis_attribute_mutation
DYNAMO_BUG
store_attrDeletedVariabler"   UserDefinedDictVariable_dict_methods_dict_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?   rN   rd   argsr@   inner_fnrY   r>   rw   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                               r4   r   SuperVariable.call_method   s     <<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,>,>!LJ.44..
  //!!<mBf-. %"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$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,, `
	
[ <;V ' 
 U*4&$8!L ` !	 	
z " =(<=4  00PsB   7c=d 3*d: e =
d
d7d22d7:eee.)r>   r=   rE   r8   NrG   r(   rN   r)   rN   r)   r   list[VariableTracker]r@   dict[str, VariableTracker]r8   r!   )r.   r/   r0   r1   r!   _nonvar_fieldsr<   rL   rk   strrt   r   r2   __classcell__rA   s   @r4   r6   r6   I   s    		'	'N
 
B7
rG5 GS GEV G R
#R
 &	R

 -R
 
R
 R
r3   r6   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   r@   rA   s       r4   r<   ExceptionVariable.__init__  sV    "6" 	 ,D1 *$/$4U$;! .d3r3   c                     Xl         g rE   )r   )r?   rT   s     r4   set_contextExceptionVariable.set_context  s    "r3   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.   rG   r?   s   r4   rH   /ExceptionVariable.reconstruct.<locals>.<lambda>  s    G,,Z9O9OPr3   Frd   r8   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_toprK   rot_nr   )rd   r   rG   r?   s     r4   codegen_attr3ExceptionVariable.reconstruct.<locals>.codegen_attr  sk    4&Dd,--zz%88>$>8!%%gmmA&67""4(r3   r   r   r   )rJ   foreachr   r   ra   r   )r?   rG   r   s   `` r4   rL   ExceptionVariable.reconstruct  sq    P	
 			"c$))ne4	)s 	)t 	) 	) 	]#[!+,r3   c                     U R                   $ rE   )r   r?   s    r4   rX   ExceptionVariable.python_type  s    }}r3   rN   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"   )msgrN   s    r4   raise_error3ExceptionVariable.call_setattr.<locals>.raise_error  s    $Y:J3:O9PQr3   r   r   Tz9exception cause must be None or derive from BaseExceptionr   )TFr   z<Set Exception object `__traceback__` attribute to not-`None`zcall_setattr ry   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	   rF   r   !UserDefinedExceptionClassVariable"UserDefinedExceptionObjectVariabler   r   r   r   r   SUPPORTABLE)r?   rN   r   r   r   rd   s    `    r4   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 ))$//r3   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?   rN   rd   r   r@   tbrA   s         r4   r   ExceptionVariable.call_method  s`    = $$R/$//%%DRb"2?"CRHK7&r>>r3   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   rn   )
r   r   r   r	   r"   ListVariabler   rY   r;   rt   )r?   rN   rd   rA   s      r4   rt   ExceptionVariable.var_getattr  s    = ###[ >>!++,,,_$--d33V^))$))DKKHHw"2,,r3   c                 N    U R                   R                   SU R                   S3$ )N())rA   r.   r   r   s    r4   __str__ExceptionVariable.__str__  s$    ..))*!DMM?!<<r3   )r   r   r   r   r   r   r   )rT   r   r   )r.   r/   r0   r1   r<   r   rL   rX   r!   r   r   rt   r  __repr__r2   r   r   s   @r4   r   r     sO    4"#-*70#70 "70 	70r?-= Hr3   r   c                       \ rS rSrSrSrg)UnknownVariablei  z
It could be anything!
r-   Nr.   r/   r0   r1   __doc__r2   r-   r3   r4   r
  r
    s    r3   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   r@   rA   s      r4   r<    DelayGraphBreakVariable.__init__  s    "6"r3   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   rd   r   r?   rN   r   r@   s       r4   r   %DelayGraphBreakVariable.call_function  sH     	9t{{m,![[--/0DHH:G	
r3   )r   rE   r   	r.   r/   r0   r1   r  r<   r   r2   r   r   s   @r4   r  r    s=    
#
 &
 -	

 

 
r3   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?   rG   s     r4   rL   ComptimeVariable.reconstruct)  s    !"<==r3   rN   r)   rd   r8   r!   c                 b    SSK J n  SSKJn  U" [        X25      [	        U R
                  U5      S9$ )Nr   )comptimer    )r$   rn   )r  	functionsr$   r_   r   rY   )r?   rN   rd   r  r$   s        r4   rt   ComptimeVariable.var_getattr,  s,    ' 	4#H#Jt{{D,I
 	
r3   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  ra   r   r$   get_functionr#   get_codeclosureco_freevarsr   r   	f_globalsfn_namerW   defaultstupler   RuntimeErrorr[   r	   r"   rs   )r?   rN   r   r@   r  fncoder   s           r4   r   ComptimeVariable.call_function6  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6r3   r-   Nr   r   )
r.   r/   r0   r1   r  rL   r   rt   r   r2   r-   r3   r4   r  r  #  sS    
>
5 
S 
EV 
'7#'7 &'7 -	'7
 
'7r3   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$ )	CellVariablei`  pre_existing_contentsN
local_namer8   c                 2   > [         TU ]  " S0 UD6  Xl        g r:   )r;   r<   r.  )r?   r.  r@   rA   s      r4   r<   CellVariable.__init__m  s     	"6"%:"r3   )r.  rE   )r.   r/   r0   r1   r   r!   __annotations__r/  r   r<   r2   r   r   s   @r4   r-  r-  `  sF     $O44 !%J$ BF;%-o%>;	; ;r3   r-  c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )NewGlobalVariableit  c                 &   > [         TU ]  " S0 UD6  g r:   r;   r<   r?   r@   rA   s     r4   r<   NewGlobalVariable.__init__u      "6"r3   r-   r   )r.   r/   r0   r1   r<   r2   r   r   s   @r4   r4  r4  t  s    # #r3   r4  c                 *   ^  U 4S jn[         Ul        U$ )Nc                  (   > TR                   " U 0 UD6$ rE   )apply)r   r@   fn_clss     r4   trampoline_autograd_applyDproduce_trampoline_autograd_apply.<locals>.trampoline_autograd_applyz  s    ||T,V,,r3   )!produce_trampoline_autograd_apply_origin)r=  r>  s   ` r4   r@  r@  y  s    - )J%$$r3   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 subclassr=  c                 2   > [         TU ]  " S0 UD6  Xl        g r:   )r;   r<   r=  )r?   r=  r@   rA   s      r4   r<   !AutogradFunctionVariable.__init__  s    "6"r3   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)noderI  rN   s    r4   visit2AutogradFunctionVariable.call_apply.<locals>.visit  s\    $	 8 899%%U2$(M$	 : :;;##B''$(M ( <r3   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 ry   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   rn   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!   rM  r   is_grad_enabledr   capture_autograd_functionwarningswarn"torch._functorch.autograd_functionrO  torch.autograd.functionrP  r=  rR  rS  vjpautogradFunctionr   r   r   jvphigher_order_opsrQ  rY   r   import_sourcer/   r.   backwardr   r   rq   r   FUNCTION_MATCHAutogradFunctionContextVariablers   r   r   r   inspect	signaturera   _parametersr	   r$   r   r   r   r   r[   )r?   rN   r   r@   rM  rO  rP  
forward_fnis_setup_ctx_definedvjp_fnjvp_fnrQ  rY   r   fwd_srcsetup_ctx_srcr)  ctxsigrI  s    `                 @r4   
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
r3   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   r`  rn   )r=  r`  r[   r\   r   _dynamoexternal_utilsFakeBackwardCFunctionr   r   r   r   rY   r	   r$   r   )r?   rN   r   r@   r)  	fn_sources         r4   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
 	
r3   c                 ,    [        U R                  5      $ rE   )rC  r=  r  s       r4   r   &AutogradFunctionVariable.call_function  s    '44r3   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   )rN   proxyr`  rn   z$Unsupported autograd.Function methodrx   ry   ,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   )builderrz  r   is_callable_allowedr=  r@  r   create_proxyr   rn  ru  rY   r   rc  getattr_staticr   r   r   __get__lookupcreate_with_sourcer   r   r	   r   r   r   )
r?   rN   rd   r   r@   rz  r>  rY   objr   s
             r4   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!)r=  r   r   )rN   r)   r   r   r@   r   )r.   r/   r0   r1   r  r!   r   r<   rn  ru  r   r   r2   r   r   s   @r4   rC  rC    s\    7 			'	'N
||
5>#> &	>
 -> >r3   rC  c                   F    \ rS rSr% \R
                  " \S9r\\   \	S'   Sr
g)SavedTensorBoxiY  )default_factorytensorsr-   N)r.   r/   r0   r1   dataclassesfieldlistr  r!   r2  r2   r-   r3   r4   r  r  Y  s    %0%6%6t%LGT/"Lr3   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$ )rb  i^  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  r@   rA   s	           r4   r<   (AutogradFunctionContextVariable.__init__j  s1     	FuFvF"* 0"4r3   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rE   )r   r	   rH  rI  .0xs     r4   	<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partialrb  r  )rN   r   r@   r  outs        r4   rs   &AutogradFunctionContextVariable.createz  s    $ %%   ii$$55NN##///,.!1	 

 
r3   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    r4   as_proxy(AutogradFunctionContextVariable.as_proxy  sA    ::'#D6*25)445 zzr3   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 methodrx   ry   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   ra   r   r  r	   r"   rs   r   r   r   r  r  rY   r   r   track_save_for_backwardr  append)r?   rN   rd   r   r@   argrA   s         r4   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6r3   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      $ rE   )r   )r   r@   rd   r?   rN   s     r4   rH   =AutogradFunctionContextVariable.var_getattr.<locals>.<lambda>  s    (8(8T4(Pr3   r  r  )r   r  r	   TupleVariabler  r  r  r"   rs   rY   r   r!   r   r\   r;   rt   r?   rN   rd   rY   rA   s   ``` r4   rt   +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,,r3   )r  r  r  r  )NFNNNr   NNr   r   )r.   r/   r0   r1   r  r'   r   r<   r   rs   r  r   rt   r2   r   r   s   @r4   rb  rb  ^  s    
 	 
#	1	1	N 5 
5 5   (	.7#.7 &	.7
 -.7 
.7`- -r3   rb  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  r6  )r?   r\   r   r@   rA   s       r4   r<   AutogradEngineVariable.__init__  s     	FuFvFr3   c                    US:X  a  [         R                  R                  R                  (       a  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=Truern   z7Unsupported torch._C._ImperativeEngine.queue_callback()rx   ry   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   rq  compiled_autogradin_compiled_autograd_region	one_graphr	   r$   rr  FakeCompiledAutogradEnginer  rY   r   r   r   get_ca_final_callbacks_varr   r?   rN   rd   r   r@   s        r4   r   "AutogradEngineVariable.call_method  s     ##}}..JJ|| 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r3   r-   rE   r   r   	r.   r/   r0   r1   r  r<   r   r2   r   r   s   @r4   r  r    sT     G
 
G G### &	#
 -# 
# #r3   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)  r@   rA   s      r4   r<   LambdaVariable.__init__  s    "6"r3   c                 &    U R                   " U0 UD6$ rE   r)  r  s       r4   r   LambdaVariable.call_function  s     ww'''r3   r  r   r   )r.   r/   r0   r1   r<   r   r2   r   r   s   @r4   r   r     s8    (#( &( -	(
 
( (r3   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U =r$ )rp   i  rd   py_typer8   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  rd   r  )r?   r  rd   r  r@   rA   s        r4   r<   GetAttrVariable.__init__#  sH    "6"#////$$$$$	r3   c                 R   > U R                   b  U R                   $ [        TU ]	  5       $ rE   )r  r;   rX   r?   rA   s    r4   rX   GetAttrVariable.python_type+  s%    <<#<<7&((r3   c                 h    U R                   R                   SU R                   SU R                   S3$ Nr  z, r  )rA   r.   r  rd   r   s    r4   r  GetAttrVariable.__repr__1  s.    ..))*!DHH:R		{!DDr3   
base_proxyc                     [        X5      $ rE   )r_   )r  r   s     r4   create_getattr_proxy$GetAttrVariable.create_getattr_proxy4  s    z((r3   c                 r    [         R                  U R                  R                  5       U R                  5      $ rE   )rp   r  r  r  rd   r   s    r4   r  GetAttrVariable.as_proxy8  s&    33DHH4E4E4GSSr3   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_   rd   r   r   )r?   constants     r4   rW   "GetAttrVariable.as_python_constant;  sO    88..0	M8YY// 	M%.@&ABL	Ms	   1 ArN   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      $ rE   )r   r  r	   rJ  r   r   get_submodule
module_keyrd   rb   rc  r  )r?   rN   rd   step1step2s        r4   const_getattrGetAttrVariable.const_getattrB  s    $((I$>$>??%%		''(;(;<99ENN*%%&&uii8~~%%%%%e22r3   c                 |    U" U R                   5        UR                  UR                  U R                  5      5        g rE   )r  rK   create_load_attrsrd   r  s     r4   rL   GetAttrVariable.reconstructM  s+    g77		BCr3   r   r@   c                 N    U R                   R                  XR                  X#5      $ rE   )r  r   rd   r  s       r4   r   GetAttrVariable.call_functionQ  s     xx##B		4@@r3   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__rc   rb   r   rc   r   r    __contains__TF__setitem__)directly_update_dict)rd   is_python_constantr   r  r	   r'   rJ  r   rW   has_key_in_generic_dictrt   ra   r"   r   convert_to_unspecializedr;   r   )r?   rN   rd   r   r@   r  keyrA   s          r4   r   GetAttrVariable.call_methodY  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::r3   )rd   r  r  rE   r   r   r   r   )r.   r/   r0   r1   r!   r   r<   rX   r   r  r   r   fxProxyr  r  rW   r  rL   r   r  dictr   r2   r   r   s   @r4   rp   rp     s     
	'	'N )E# E ) ) )TM	3DA#A &A -	A
 
AB;#B; ?#	B;
 S/)*B; 
B; B;r3   rp   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  r@   rA   s      r4   r<   MethodWrapperVariable.__init__  s!    "6",r3   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	   rH  ra   rt   r   r.   r[   r<   r   rF   r   r;   r   )r?   rN   r   r@   self_objwrapper_namefn_objrA   s          r4   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6r3   c                     gNTr-   r   s    r4   r  (MethodWrapperVariable.is_python_constant      r3   c                     U R                   $ rE   )r  r   s    r4   rW   (MethodWrapperVariable.as_python_constant  s    """r3   )r  r  r   r   )
r.   r/   r0   r1   r<   r   r  rW   r2   r   r   s   @r4   r  r    sB    
7#7 &7 -	7
 
7># #r3   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  r@   rA   s      r4   r<   !GetSetDescriptorVariable.__init__  s    "6"	r3   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;   rt   r  s       r4   rt   $GetSetDescriptorVariable.var_getattr  sN    9Y7F"((YY->->GG7&r00r3   c                     gr   r-   r   s    r4   r  +GetSetDescriptorVariable.is_python_constant  r  r3   c                     U R                   $ rE   r  r   s    r4   rW   +GetSetDescriptorVariable.as_python_constant  s    yyr3   r  r   r   )
r.   r/   r0   r1   r<   rt   r  rW   r2   r   r   s   @r4   r  r    s    1 r3   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_torchr8   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\   r@   rA   s      r4   r<   PythonModuleVariable.__init__  sB    "6"


e+Wtzz/B/B/M/Mh/Wr3   c                 "    [         R                  $ rE   )r   
ModuleTyper   s    r4   rX    PythonModuleVariable.python_type  s    r3   c                     U R                   $ rE   r\   r   s    r4   rW   'PythonModuleVariable.as_python_constant      zzr3   c                 "    SU R                    S3$ )NzPythonModuleVariable(r  r  r   s    r4   r  PythonModuleVariable.__repr__  s    &tzzl!44r3   c                 l    [        U R                  U5      n[        R                  R	                  U5      $ rE   )r   r\   r	   r"   rs   r?   rN   rd   r   s       r4   call_obj_hasattr%PythonModuleVariable.call_obj_hasattr  s)    T*))0088r3   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rE   )r   r   r   r   r  r\   rb   r_   r   r   rY   r   r!   r   )r?   rN   rd   r   rY   s        r4   rt    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.   r/   r0   r1   r!   r   r   r  r<   rX   rW   r   r  r#  rt   r2   r   r   s   @r4   r  r    sa     
	'	'NXe.. XT X
 5# 59= =r3   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      r4   r<   TypingVariable.__init__      "6"
r3   rN   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)ra   r\   rW   r(  r   )r?   rN   rd   r   r@   
new_typings         r4   r   TypingVariable.call_method  sE     = SY!^DG$>$>$@AJ!*--CDr3   rd   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}  r1  r2  r   r	   rp   r   r   r   r   r_   r\   rY   r   rs   )r?   rN   rd   r1  r2  r\   r   s          r4   rt   TypingVariable.var_getattr  s    ?)),,T8899!!>>tJJ??,,T88

D);;$T[[$7K"23E::$++B66r3   c                     U R                   $ rE   r  r   s    r4   rW   !TypingVariable.as_python_constant(  r  r3   c                 X    UR                  UR                  U R                  5      5        g rE   )append_outputcreate_load_constr\   r  s     r4   rL   TypingVariable.reconstruct+  s!    0 	g77

CDr3   r  r   r   )rG   r(   r8   N)r.   r/   r0   r1   r<   r   r   rt   rW   rL   r2   r   r   s   @r4   r(  r(    s]    E#E &	E
 -E 
E75 7S 7 E Er3   r(  )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)utilsr<  r   rb   callabler_   )r<  np_fn_to_tnp_fnnp_modtnp_modr%  tnp_fnnp_fns          r4   get_np_to_tnp_maprD  F  sk     )O+113&//557OG $FT::5:-3E*  8 4 r3   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.
)rD  r   )mkvs      r4   get_tnp_to_np_maprI  [  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$ )NumpyVariableie  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:   r*  r  s      r4   r<   NumpyVariable.__init__l  r,  r3   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)r/   splitra   constant_fold_functionsclsr)  mods      r4   can_constant_fold_through'NumpyVariable.can_constant_fold_throughp  sH    mm!!#&3x1}RaWh,?!???0000r3   c                     UR                   R                  S5      n[        U5      S:  a  US S SS/:X  d   e[        R	                  US 5      $ rO  )r/   rR  ra   np_constant_collections_maprc   rT  s      r4    get_constant_collection_for_func.NumpyVariable.get_constant_collection_for_funcv  sL    mm!!#&3x1}RaWh,?!???*..r488r3   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: ry   ztorch._numpy.randomz
delegate 'z' to NumPy itself via zconfig.use_numpy_random_stream=r   )r   trace_numpyr   r\   r=  r^  tensorr_  rD  rc   r[  rW   r   r   r.   r/   use_numpy_random_streamr0   
patch_argsrW  r   r	   r"   rs   r   r  r   )r?   rN   r   r@   r^  r_  r   collection_variable_typr  rG  rH  r   r{  s                r4   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        r4   r   NumpyVariable.call_method  s     	gr3   c                     U R                   $ rE   r  r   s    r4   rW    NumpyVariable.as_python_constant  r  r3   c                    > [         R                  (       a5  [        U R                  [        5      (       a  U R                  R
                  $ [        TU ]  5       $ rE   )r   r`  r   r\   r[   r.   r;   r  r  s    r4   r  NumpyVariable.as_proxy  s<    *TZZ">"> ::&&&w!!r3   r  r   r   )r.   r/   r0   r1   r  tnp
issubdtyperS  r<   r   rW  r[  r   r   rW   r  r2   r   r   s   @r4   rK  rK  e  s      #~~/ 1 1
 9 9
@:#@: &@: -	@:
 
@:D# &	
 - 
" "r3   rK  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  r8   c                 &   > [         TU ]  " S0 UD6  g r:   r6  r7  s     r4   r<   NullVariable.__init__  r9  r3   c                     g)Nrp  r-   r   s    r4   r  NullVariable.__repr__  s    r3   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   r7  r   r  s     r4   rL   NullVariable.reconstruct  s-    g%LM0=>r3   r-   r   r   )
r.   r/   r0   r1   r<   r   r  rL   r2   r   r   s   @r4   rp  rp    s    ## ? ?r3   rp  c                       \ rS rSrSrSrg)r   i  z"Marker used to implement delattr()r-   Nr  r-   r3   r4   r   r     s    ,r3   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rE   )r  r  s     r4   r  .StringFormatVariable.create.<locals>.<genexpr>  s#      
C   ""Cs   )all	itertoolschainvaluesr	   r"   rs   formatrW   r   r  r  )rU  r~  sym_args
sym_kwargsrH  rG  s         r4   rs   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r8   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  r@   rA   s        r4   r<   StringFormatVariable.__init__  s6    "6"-----* $r3   c                     U R                   R                   SU R                  < SU R                  < SU R                  < S3$ r  )rA   r.   r~  r  r  r   s    r4   r  StringFormatVariable.__repr__  sB    ..))*!D,>,>+ADMMCTTVW[WfWfViijkkr3   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  )rK   r8  r~  create_load_attrr   s   r4   rH   2StringFormatVariable.reconstruct.<locals>.<lambda>  s7    G))--d.@.@A,,X6r3   T)call_function_exCALL_FUNCTION_EXr    )r  )rJ   r	   r  r  r  r   r"   rs   ConstDictVariabler7  r   )r?   rG   rG  rH  r@   s   ``   r4   rL    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.   r/   r0   r1   r  r!   r   r   rs   r<   r   r  rL   r2   r   r   s   @r4   r}  r}    sP     &G(F(FGND D%l# lM Mr3   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:   r*  r  s      r4   r<   DebuggingVariable.__init__  r,  r3   c                     [        U 5      =(       aX    [        U [        R                  [        R                  45      =(       a'    U [
        R                  R                  R                  ;   $ rE   )	r>  r   r   r   BuiltinFunctionTyper   rq  r   reorderable_logging_functions)r  s    r4   is_reorderable_logging_function1DebuggingVariable.is_reorderable_logging_function!  sO     SM J3!3!3U5N5N OPJu}}++III	
r3   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 ry   z is not yet implemented.)exportcan_reorder_logsr\   r   debug_localsr  r  r  s       r4   r   DebuggingVariable.call_function)  sl    99$$TZZ>>0 =#fAfX-EG
 	d4j12r3   c                 8    U R                   R                  U5      $ rE   )rY   rL   r  s     r4   rL   DebuggingVariable.reconstruct6  s    {{&&w//r3   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	   rH  r"   r}  pytreetree_leavesr   )r)  r   r@   allowed_input_types	flat_argsr  s         r4   r  "DebuggingVariable.can_reorder_logs9  sR     $$&& 
 &&~6	Cc77  r3   r  r   r   r   )r8   T)r.   r/   r0   r1   r  r<   r   r  r   rL   r  r2   r   r   s   @r4   r  r    s?    
 
 
30  r3   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$ )LoggingLoggerVariableiN  z4
Represents a call to any of logging.Logger methods
c                 2   > [         TU ]  " S0 UD6  Xl        g r:   r*  r  s      r4   r<   LoggingLoggerVariable.__init__S  r,  r3   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   rq  r   ignore_logger_methodsr	   r"   rs   r   )r?   rN   rd   r   r@   methodr  s          r4   r   !LoggingLoggerVariable.call_methodW  sw     99T406:t4**5==+?+?+U+UVV--44T::Y	
r3   r  r   r   r  r   s   @r4   r  r  N  s=    
#
 &	

 -
 

 
r3   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)ConstantLikeVariableil  z8self.value is a compile-time constant, but not a literalr   )dtypefloatinggenericinvalid_typer-   r8   c                 2   > [         TU ]  " S0 UD6  Xl        g r:   r*  r  s      r4   r<   ConstantLikeVariable.__init__z  r,  r3   c                     U R                   $ rE   r  r   s    r4   rW   'ConstantLikeVariable.as_python_constant~  r  r3   rN   r)   r   r@   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)NrP  z(*z, **r  z() -> )rW   r   r   r   _error_prefixr_   r\   r	   r"   ro   rs   r   reMatchConstantRegexMatchVariable)r?   rN   rd   r   r@   r  cargsrG  rH  ckwargsr   s              r4   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rd   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      $ rE   )r_   r\   r   np_floatingfloatnp_dtypeNumpyDTypeVariabler[   rZ   
np_genericrK  r	   r"   ro   rs   rp   r"  s       r4   rt    ConstantLikeVariable.var_getattr  s    T*f..//6]Ffmm,,%f--fd##
6??(K(K ((%%0088--44V<<t**r3   r  r   )r.   r/   r0   r1   r  r  rg  r  r  r  r  r  r  ImportErrorr[   r<   rW   r  r!   r  r   r   rt   r2   r   r   s   @r4   r  r  l  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.   r/   r0   r1   r  r2   r-   r3   r4   r  r    s     Mr3   r  c                       \ rS rSrSrSrg)r  i  zre.Matchr-   Nr  r-   r3   r4   r  r    s    Mr3   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<   r7  s     r4   r<   TorchVersionVariable.__init__  sA    '5#4#45g%"3"3333"6"r3   r-   r   )r.   r/   r0   r1   r  r<   r2   r   r   s   @r4   r  r    s    'M# #r3   r  c                       \ rS rSrSrSrg)NumpyTypeInfoVariablei  znp.iinfo/np.finfor-   Nr  r-   r3   r4   r  r    s    'Mr3   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    r4   r  NumpyDTypeVariable.as_proxy  s     zz'''r3   r-   N)r.   r/   r0   r1   r  r  r2   r-   r3   r4   r  r    s    #M(r3   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:   r6  r7  s     r4   r<   RandomClassVariable.__init__  r9  r3   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   )ra   r   r	   r"   rs   RandomVariablebaseValueMutationNew)r?   rN   r   r@   r  s        r4   r   !RandomClassVariable.call_function  sh    t9q=8978:=d)q.y))006dSTgY^^%D%D%F
 	
r3   r-   r   r   r  r   s   @r4   r  r    s    #
 
r3   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  r8   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  r@   rA   s       r4   r<   RandomVariable.__init__  s|     	"6"//5555 --/DKKK  1040@4**,dD ---DKr3   c                 "    [         R                  $ rE   )r  r  r   s    r4   rX   RandomVariable.python_type  s    }}r3   c                     U R                   $ rE   r  r   s    r4   rW   !RandomVariable.as_python_constant  s    {{r3   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_   rc  	isbuiltinr  )r   rd   meths      r4   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 
 r3   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rE   )r[   intr  s     r4   r  -RandomVariable.check_state.<locals>.<genexpr>   s     48a47c>8s    r   )r[   r'  r   r  r  )states    r4   check_stateRandomVariable.check_state  s    E{e###E!H~$$$E!H~&&&45844444Qx4a>U#:::#:r3   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"   rs   )r  r  s     r4   
wrap_stateRandomVariable.wrap_state#  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$ rE   )rW   r  r  )r  	state_objs     r4   unwrap_stateRandomVariable.unwrap_state0  s$    ,,.	""9-r3   rN   r)   r   r@   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$ rE   )r  r  r  r_   )r   r@   rrd   r  s      r4   call_random_meth4RandomVariable.call_method.<locals>.call_random_methN  s1    MMO

5!q$'888r3   )r   r   mutationr  r  rW   r   r	   r"   rs   r  r  r  r
  r  r_   r%   r;   r   )r?   rN   rd   r   r@   r  r  r   r  rG  rH  r  rA   s     `        @r4   r   RandomVariable.call_method6  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  )rK   create_load_python_moduler  r  rG   s   r4   rH   ,RandomVariable.reconstruct.<locals>.<lambda>_  s1    G))55f=,,X6r3   r   Fr  r    T)rJ   r   r   r   r  r  r  pop_topr  s    `r4   rL   RandomVariable.reconstruct]  sz    	
 	a' 	*% 4 4 678a&r3   r  r  r   )r.   r/   r0   r1   r  r!   r   r  r   r  r  r<   rX   rW   r   r  r  r  r
  r  r  r   r   rL   r2   r   r   s   @r4   r  r    s    			'	'N
 )-*..v}}%. '.
 
. .  $ ; ; 

 

  
%;#%; ?#	%;
 S/)*%; 
%;N r3   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
$ )	WeakRefVariableip  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__)rc   r  r   r!   r   r   r  )	rN   weakref_valueoptionsrY   callbackcallback_sourcecallback_vtreferentreferent_vts	            r4   r   WeakRefVariable.buildq  s    Xt, -- GZ%G%++B/J ?5-f5%++B&A"{C7CCr3   c                 >   > [         TU ]  " S0 UD6  Xl        X l        g r:   )r;   r<   r$  r"  )r?   r$  r"  r  rA   s       r4   r<   WeakRefVariable.__init__}  s    #7#&&r3   c                     U R                   $ rE   )r$  r  s       r4   r   WeakRefVariable.call_function  s     r3   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   r4   rH   -WeakRefVariable.reconstruct.<locals>.<lambda>  s    g&>&>y%&Pr3   r   F)rJ   r$  r"  rK   r
   r  s    `r4   rL   WeakRefVariable.reconstruct  sD    PQ  !  !21e<=r3   )r"  r$  r   r   )r.   r/   r0   r1   r   r   r<   r   rL   r2   r   r   s   @r4   r  r  p  sQ    	D 	D'
 #  &  -	 
 
 > >r3   r  )pr  r  r  rc  r  r  r  rx  r   rV  typingr   r   torch._Cr   torch._numpyrQ  rm  torch.utils._pytreer=  _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$   user_definedr%   r&   r'   torch._dynamo.codegenr(   torch._dynamo.symbolic_convertr)   r+   r6   r   r
  r  r  r-  r4  r@  rC  	dataclassr  rb  r  r   rp   r  r  r  r(  	lru_cacherD  rI  rK  rp  r   r}  r  r  r  r  r  r  r  r  finfoiinfor  rZ  r  r  r  r-   r3   r4   <module>r@     s  "      	 
   *   $ $ @ @ N F K K 0 5 	 	 	 " & G X X /D	 	u
O u
p	A AHo 
o 
0:7 :7z;? ;(# #
%U Up M M Mz-&? z-z06 0f(_ (;o ;D)#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 >r3   