
    IЦiYg                        S SK r S SKrS SKrS SKJrJrJr  S SKJrJ	r	J
r
  SSKJr  SSKJrJr  SSKJr  \	R"                  \	R$                  \	R&                  \	R(                  \	R$                  \	R$                  \	R(                  \	R(                  \	R*                  \	R*                  \	R,                  \	R,                  \	R.                  \	R.                  \	R0                  \	R0                  \	R2                  \	R2                  \	R4                  \	R4                  0
r\	R"                  \	R*                  \	R&                  \	R,                  \	R*                  \	R*                  \	R,                  \	R,                  \	R$                  \	R*                  \	R(                  \	R,                  \	R.                  \	R.                  \	R0                  \	R0                  \	R2                  \	R2                  \	R4                  \	R4                  0
r\	R"                  \	R.                  \	R&                  \	R0                  \	R*                  \	R.                  \	R,                  \	R0                  \	R$                  \	R.                  \	R(                  \	R0                  \	R.                  \	R.                  \	R0                  \	R0                  \	R2                  \	R2                  \	R4                  \	R4                  0
r\	R"                  \	R2                  \	R&                  \	R4                  \	R$                  \	R2                  \	R(                  \	R4                  \	R2                  \	R2                  \	R4                  \	R4                  \	R*                  \	R2                  \	R,                  \	R4                  \	R.                  \	R2                  \	R0                  \	R4                  0
rS rS	\S
   4S jr \RB                  " SS9 " S S\
5      5       r"\RB                  " SS9 " S S\
5      5       r#\RB                  " SS9 " S S\
5      5       r$\RB                  " SS9 " S S\
5      5       r%\RB                  " SS9 " S S\
5      5       r&\RB                  " SS9 " S S\5      5       r'\RB                  " SS9 " S S\'5      5       r(\RB                  " SS9 " S S\5      5       r)\RB                  " SS9 " S S\
5      5       r*\RB                  " SS9 " S  S!\5      5       r+\RB                  " SS9 " S" S#\)5      5       r,\RB                  " SS9 " S$ S%\)5      5       r-\RB                  " SS9 " S& S'\
5      5       r. " S( S)\R^                  5      r0\RB                  " SS9 " S* S+\5      5       r1\RB                  " SS9 " S, S-\5      5       r2\RB                  " SS9 " S. S/\5      5       r3\RB                  " SS9 " S0 S1\5      5       r4\RB                  " SS9 " S2 S3\5      5       r5 " S4 S5\5      r6\RB                  " SS9 " S6 S7\5      5       r7\RB                  " SS9 " S8 S9\5      5       r8\RB                  " SS9 " S: S;\85      5       r9\RB                  " SS9 " S< S=\85      5       r:\RB                  " SS9 " S> S?\5      5       r;\RB                  " SS9 " S@ SA\5      5       r<\RB                  " SS9 " SB SC\5      5       r=\RB                  " SS9 " SD SE\5      5       r>\RB                  " SS9 " SF SG\>5      5       r?\RB                  " SS9 " SH SI\?5      5       r@\RB                  " SS9 " SJ SK\>5      5       rA\RB                  " SS9 " SL SM\
5      5       rB\RB                  " SS9 " SN SO\
5      5       rC\RB                  " SS9 " SP SQ\
5      5       rD\RB                  " SS9 " SR SS\5      5       rE\RB                  " SS9 " ST SU\5      5       rF\RB                  " SS9 " SV SW\5      5       rG\RB                  " SS9 " SX SY\5      5       rH\RB                  " SS9 " SZ S[\
5      5       rI\RB                  " SS9 " S\ S]\
5      5       rJS^S_.S	\
4S` jjrKS	\
4Sa jrLS	\
4Sb jrMS	\
4Sc jrNS	\
4Sd jrOg)e    N)AnyOptionalUnion)ChainedSourceGuardSourceSource   )utils)create_call_functioncreate_instruction)	enum_reprc                     [        U [        5      (       a  g U R                  5       [        R                  :X  a  g g! [
         a     gf = fNTF)
isinstanceConstantSourceguard_sourcer   CONSTANTNotImplementedErrorsources    S/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/_dynamo/source.pyis_constant_sourcer   M   sR    &.)) K$8$88 9
   s   "= 
A
	A
r   )GetItemSourceODictGetItemSourcec                    U R                   R                  U5        [        U R                  [        5      (       a  U R                  R                  U5        g U(       aF  [        U [
        5      (       d   eUR                  UR                  U R                  5       5      5        g UR                  UR                  U R                  5      5        g N)	basereconstructr   indexr   r   append_outputcreate_load_constunpack_slice)r   codegenindex_is_slices      r   reconstruct_getitemr%   Y   s     KKG$&,,''  )fm4444!!'";";F<O<O<Q"RS!!'";";FLL"IJ    T)frozenc                   N    \ rS rSr% \\S'   Sr\\S'   Sr\\S'   S r	S r
S rS	rg
)LocalSourceg   
local_nameFis_inputis_derefed_cell_contentsc                     U R                   (       a  UR                  U R                  5        g UR                  UR	                  U R                  5      5        g r   )r-   
load_derefr+   r    create_loadselfr#   s     r   r   LocalSource.reconstructs   s:    ((t/!!'"5"5doo"FGr&   c                 "    [         R                  $ r   )r   LOCALr2   s    r   r   LocalSource.guard_sourcey   s       r&   c                 4    S[        U R                  5       S3$ )NzL[])reprr+   r6   s    r   nameLocalSource.name|   s    D)*!,,r&    N)__name__
__module____qualname____firstlineno__str__annotations__r,   boolr-   r   r   r;   __static_attributes__r=   r&   r   r)   r)   g   s0    O Hd
 &+d*H!-r&   r)   c                   2    \ rS rSr% \\S'   S rS rS rSr	g)SyntheticLocalSource   r+   c                 X    UR                  UR                  U R                  5      5        g r   )r    r0   r+   r1   s     r   r    SyntheticLocalSource.reconstruct   s    g11$//BCr&   c                 "    [         R                  $ r   )r   SYNTHETIC_LOCALr6   s    r   r   !SyntheticLocalSource.guard_source   s    ***r&   c                 $    SU R                   < S3$ )NzSYNTHETIC_LOCAL[r9   )r+   r6   s    r   r;   SyntheticLocalSource.name   s    !$//!4A66r&   r=   N
r>   r?   r@   rA   rB   rC   r   r   r;   rE   r=   r&   r   rG   rG      s    OD+7r&   rG   c                   2    \ rS rSr% \\S'   S rS rS rSr	g)RandomValueSource   random_call_indexc                 "    [         R                  $ r   )r   RANDOM_VALUEr6   s    r   r   RandomValueSource.guard_source   s    '''r&   c                    UR                  UR                  UR                  R                  R                  5      5        UR                  UR                  U R                  5      5        UR                  [        S5      5        g NBINARY_SUBSCR)r    r0   txoutputrandom_values_varr!   rT   r   r1   s     r   r   RandomValueSource.reconstruct   s^    g11'**2C2C2U2UVWg778N8NOP0ABr&   c                      SU R                    3$ )Nrandom_value_)rT   r6   s    r   r;   RandomValueSource.name   s    t55677r&   r=   N)
r>   r?   r@   rA   intrC   r   r   r;   rE   r=   r&   r   rR   rR      s    (C
8r&   rR   c                   2    \ rS rSr% \\S'   S rS rS rSr	g)GlobalSource   global_namec                 V    UR                  UR                  U R                  SS95        g NTaddr    create_load_globalrf   r1   s     r   r   GlobalSource.reconstruct   s&    g889I9It8TUr&   c                 "    [         R                  $ r   r   GLOBALr6   s    r   r   GlobalSource.guard_source       !!!r&   c                 4    S[        U R                  5       S3$ )NG[r9   r:   rf   r6   s    r   r;   GlobalSource.name   s    D))*+1--r&   r=   NrP   r=   r&   r   rd   rd      s    V".r&   rd   c                   2    \ rS rSr% \\S'   S rS rS rSr	g)GlobalWeakRefSource   rf   c                 j   ^ ^ TR                  UU 4S j5        TR                  [        SS5      5        g )Nc                  V   > T R                  T R                  TR                  SS95      $ rh   rk   r#   r2   s   r   <lambda>1GlobalWeakRefSource.reconstruct.<locals>.<lambda>   s)    G))**4+;+;*Fr&   r   Fadd_push_nullextend_outputr   r1   s   ``r   r   GlobalWeakRefSource.reconstruct   s.    	

 	21e<=r&   c                 "    [         R                  $ r   ro   r6   s    r   r    GlobalWeakRefSource.guard_source   rr   r&   c                 4    S[        U R                  5       S3$ )Nrt   z]()ru   r6   s    r   r;   GlobalWeakRefSource.name   s    D))*+3//r&   r=   NrP   r=   r&   r   rx   rx      s    >"0r&   rx   c                   &    \ rS rSrS rS rS rSrg)WeakRefCallSource   c                 j   ^ ^ TR                  UU 4S j5        TR                  [        SS5      5        g )Nc                  :   > TR                   R                  T 5      $ r   r   r   r|   s   r   r}   /WeakRefCallSource.reconstruct.<locals>.<lambda>   s    dii&;&;G&Dr&   r   Fr   r1   s   ``r   r   WeakRefCallSource.reconstruct   s(    DE21e<=r&   c                 6    U R                   R                  5       $ r   r   r   r6   s    r   r   WeakRefCallSource.guard_source       yy%%''r&   c                 <    U R                   R                  5        S3$ )Nz()r   r;   r6   s    r   r;   WeakRefCallSource.name   s    )).."#2&&r&   r=   Nr>   r?   r@   rA   r   r   r;   rE   r=   r&   r   r   r      s    >('r&   r   c                       \ rS rSrSrg)CallFunctionNoArgsSource   r=   Nr>   r?   r@   rA   rE   r=   r&   r   r   r          r&   r   c                   8    \ rS rSr% \\S'   S rS rS rS r	Sr
g)	
AttrSource   memberc                 :   U R                   (       d   S5       eSU R                  ;   as  U R                  R                  S5      n[        R	                  U S[        U R                   SR                  US S 5      5      5        [        R	                  U SUS   5        g g )Nz9Can't construct an AttrSource without a valid base source.r   r   )r   r   splitobject__setattr__r   join)r2   member_partss     r   __post_init__AttrSource.__post_init__   s    yyUUUy$++;;,,S1LfjCHH\#2=N4OP tX|B/?@ r&   c                     U R                   R                  U5        UR                  UR                  U R                  5      5        g r   r   r   r   create_load_attrsr   r1   s     r   r   AttrSource.reconstruct   1    		g&g77DEr&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   AttrSource.guard_source   r   r&   c                     U R                   R                  5       (       d,  SU R                  R                  5        SU R                   < S3$ U R                  R                  5        SU R                    3$ )Nzgetattr(, )r   )r   isidentifierr   r;   r6   s    r   r;   AttrSource.name   s[    {{''))diinn./r$++BB)).."#1T[[M22r&   r=   N)r>   r?   r@   rA   rB   rC   r   r   r   r;   rE   r=   r&   r   r   r      s    KAF(3r&   r   c                   *    \ rS rSr% Sr\\S'   S rSrg)LocalCellSource   zw
Conceptually, this class is `LocalSource` for cell objects implicitly
generated by Python (e.g., captured variables).
r+   c                 X    UR                  UR                  U R                  5      5        g r   )r    create_load_closurer+   r1   s     r   r   LocalCellSource.reconstruct   s!     	g99$//JKr&   r=   N)	r>   r?   r@   rA   __doc__rB   rC   r   rE   r=   r&   r   r   r      s    
 OLr&   r   c                   6    \ rS rSr% Sr\\S'   S rS rS r	Sr
g)	
GradSourcei  gradr   c                     U R                   R                  U5        UR                  UR                  U R                  5      5        g r   r   r1   s     r   r   GradSource.reconstruct  r   r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   GradSource.guard_source
  r   r&   c                 T    U R                   R                  5        SU R                   3$ )Nr   )r   r;   r   r6   s    r   r;   GradSource.name  s#    )).."#1T[[M22r&   r=   N)r>   r?   r@   rA   r   rB   rC   r   r   r;   rE   r=   r&   r   r   r     s    FCF(3r&   r   c                       \ rS rSrS rSrg)ParamBufferSourcei  c                 D    [         U R                  R                  5          $ r   #_GUARD_SOURCE_SPECIALIZED_NN_MODULEr   r   r6   s    r   r   ParamBufferSource.guard_source      24993I3I3KLLr&   r=   Nr>   r?   r@   rA   r   rE   r=   r&   r   r   r     s    Mr&   r   c                       \ rS rSrSrg)UnspecializedParamBufferSourcei  r=   Nr   r=   r&   r   r   r     r   r&   r   c                   B    \ rS rSr% Sr\\   \S'   S rS r	S r
S rSrg)	EphemeralSourcei&  Ndescc                 "    [         R                  $ r   )r   	EPHEMERALr6   s    r   r   EphemeralSource.guard_source*      $$$r&   c                 L    SU R                   b  SU R                   -    S3$ S S3$ )Nz
<ephemeralz:  >)r   r6   s    r   r;   EphemeralSource.name-  s1    		0ED499,NaPP2NaPPr&   c                     [         er   r   r2   fns     r   
make_guardEphemeralSource.make_guard0      !!r&   c                     gNTr=   r6   s    r   is_ephemeralEphemeralSource.is_ephemeral3      r&   r=   )r>   r?   r@   rA   r   r   rB   rC   r   r;   r   r   rE   r=   r&   r   r   r   &  s%    D(3-%Q"r&   r   c                   &    \ rS rSrSrSrSrS rSrg)TensorPropertyi7  r   r	      c                 |    U [         R                  L a  gU [         R                  L a  gU [         R                  L a  gg )Nsizestridestorage_offset)r   SIZESTRIDESTORAGE_OFFSETr6   s    r   method_nameTensorProperty.method_name<  s:    >&&&^***^222# 3r&   r=   N)	r>   r?   r@   rA   r   r   r   r   rE   r=   r&   r   r   r   7  s    DFN$r&   r   c                   L    \ rS rSr% \\S'   Sr\\   \S'   S r	S r
S rS rS	rg)
TensorPropertySourceiE  propNidxc                     U R                   c   eU R                  [        R                  L a  U R                  b   eg U R                  c   eg r   )r   r   r   r   r   r6   s    r   r   "TensorPropertySource.__post_init__J  sD    yy$$$9955588###88'''r&   c                 ,  ^ ^ TR                  UU 4S j5        T R                  R                  T5        T R                  b*  TR	                  TR                  T R                  5      5        TR                  [        T R                  b  SOSS5      5        g )Nc                  z   > T R                  [        R                  STR                  R	                  5        35      $ )Ncall_)load_import_fromr
   r>   r   r   r|   s   r   r}   2TensorPropertySource.reconstruct.<locals>.<lambda>S  s.    G,,%		(=(=(?'@ Ar&   r   r	   F)r   r   r   r   r    r!   r   r   r1   s   ``r   r    TensorPropertySource.reconstructQ  st    	

 			g&88!!'";";DHH"EF dhh&:5I	
r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   !TensorPropertySource.guard_source_  r   r&   c                    U R                   [        R                  L a*  U R                  R	                  5        SU R
                   S3$ U R                   [        R                  L a*  U R                  R	                  5        SU R
                   S3$ U R                   [        R                  L a,  U R
                  b   eU R                  R	                  5        S3$ [        SU R                    35      e)Nz.size()[r9   z
.stride()[z.storage_offset()z
unhandled )	r   r   r   r   r;   r   r   r   AssertionErrorr6   s    r   r;   TensorPropertySource.nameb  s    99+++iinn&'xz;;YY.///iinn&'z$((1==YY.77788###iinn&''899 :dii[!9::r&   r=   )r>   r?   r@   rA   r   rC   r   r   rb   r   r   r   r;   rE   r=   r&   r   r   r   E  s*    
C#(
(	;r&   r   c                   ,    \ rS rSrS rS rS rS rSrg)NegateSourcein  c                 "    U R                   c   eg r   r   r6   s    r   r   NegateSource.__post_init__p      yy$$$r&   c                     [         er   r   r1   s     r   r   NegateSource.reconstructs  r   r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   NegateSource.guard_sourcev  r   r&   c                 <    U R                   R                  5        S3$ )Nz
.__neg__()r   r6   s    r   r;   NegateSource.namey  s    )).."#:..r&   r=   N	r>   r?   r@   rA   r   r   r   r;   rE   r=   r&   r   r  r  n  s    %"(/r&   r  c                   ,    \ rS rSrS rS rS rS rSrg)ConvertIntSourcei~  c                 "    U R                   c   eg r   r  r6   s    r   r   ConvertIntSource.__post_init__  r	  r&   c                 :    U R                   R                  U5        g r   r   r1   s     r   r   ConvertIntSource.reconstruct      		g&r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   ConvertIntSource.guard_source  r   r&   c                 >    SU R                   R                  5        S3$ )Nz!cast_symbool_to_symint_guardless(r   r   r6   s    r   r;   ConvertIntSource.name  s    2499>>3C2DAFFr&   r=   Nr  r=   r&   r   r  r  ~  s    %'(Gr&   r  c                   ,    \ rS rSrS rS rS rS rSrg)FlattenScriptObjectSourcei  c                 "    U R                   c   eg r   r  r6   s    r   r   'FlattenScriptObjectSource.__post_init__  r	  r&   c                 :    U R                   R                  U5        g r   r   r1   s     r   r   %FlattenScriptObjectSource.reconstruct  r  r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   &FlattenScriptObjectSource.guard_source  r   r&   c                 <    U R                   R                  5        S3$ )Nz.__obj_flatten__()r   r6   s    r   r;   FlattenScriptObjectSource.name  s    )).."##566r&   r=   Nr  r=   r&   r   r  r    s    %'(7r&   r  c                   ,    \ rS rSrS rS rS rS rSrg)ScriptObjectQualifiedNameSourcei  c                 "    U R                   c   eg r   r  r6   s    r   r   -ScriptObjectQualifiedNameSource.__post_init__  r	  r&   c                 :    U R                   R                  U5        g r   r   r1   s     r   r   +ScriptObjectQualifiedNameSource.reconstruct  r  r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   ,ScriptObjectQualifiedNameSource.guard_source  r   r&   c                 <    U R                   R                  5        S3$ )Nz._type().qualified_name()r   r6   s    r   r;   $ScriptObjectQualifiedNameSource.name  s    )).."##<==r&   r=   Nr  r=   r&   r   r'  r'    s    %'(>r&   r'  c                   &    \ rS rSrS rS rS rSrg)AttrProxySourcei  c                 :    U R                   R                  U5        g r   r   r1   s     r   r   AttrProxySource.reconstruct  r  r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   AttrProxySource.guard_source  r   r&   c                 <    U R                   R                  5        S3$ )Nz.get_base()r   r6   s    r   r;   AttrProxySource.name  s    )).."#;//r&   r=   Nr   r=   r&   r   r1  r1    s    '(0r&   r1  c                       \ rS rSr% \\\4   \S'   Sr\	\S'   \
R                  " SSSS9r\\S'   \
R                  " SSSS9r\\S'   S rS	 rS
 rS rSrg)DefaultsSourcei  idx_keyFis_kw)initr:   comparefield_namec           
      h   U R                   (       d   S5       eU R                  (       a  [        U R                  [        5      (       d   e[
        R                  U SS5        [
        R                  U SU R                   R                  5        SU R                   SU R                   S35        g [        U R                  [        5      (       d   e[
        R                  U SS5        [
        R                  U SU R                   R                  5        SU R                   S	U R                   S
35        g )Nz]Base must be a valid source in order to properly track and guard this Defaults to its origin.r>  __kwdefaults__r?  r   z['z']__defaults__[r9   )
r   r;  r   r:  rB   r   r   r;   r>  rb   r6   s    r   r   DefaultsSource.__post_init__  s    II	kj	k::dllC0000tW.>?g$)).."2!31TZZL4<<.PRS dllC0000tWn=g$)).."2!31TZZL$,,qQr&   c                    U R                   R                  U5        UR                  UR                  U R                  5      5        UR                  UR                  U R                  5      5        UR                  [        S5      5        g rY   )	r   r   r   r   r>  r    r!   r:  r   r1   s     r   r   DefaultsSource.reconstruct  sb    		g&g77

CDg77EF0ABr&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   DefaultsSource.guard_source  r   r&   c                     U R                   $ r   )r?  r6   s    r   r;   DefaultsSource.name  s    zzr&   r=   N)r>   r?   r@   rA   r   rb   rB   rC   r;  rD   dataclassesr>  r?  r   r   r   r;   rE   r=   r&   r   r9  r9    sa    38_E4""E5IE3I""E5IE3I"C(r&   r9  c                   Z   ^  \ rS rSr% \\S'   Sr\\S'   U 4S jrS r	S r
S rS	 rS
rU =r$ )r   i  r   Fr$   c                    > U R                   c   e[        U R                  [        5      (       a9  [        TU ]  SU R                  R                  5       5        [        TU ]  SS5        g g )Nr   r$   T)r   r   r   slicesuperr   
__reduce__)r2   	__class__s    r   r   GetItemSource.__post_init__  sU    yy$$$djj%((G)>)>)@AG 0$7 )r&   c                 `    [        XU R                  S9  UR                  [        S5      5        g )Nr$   rZ   )r%   r$   r    r   r1   s     r   r   GetItemSource.reconstruct  s&    D$:M:MN0ABr&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   GetItemSource.guard_source  r   r&   c                 N    U R                   (       d   eU R                  u  pU" U6 $ r   )r$   r   )r2   slice_class
slice_argss      r   r"   GetItemSource.unpack_slice  s(    """""&**J''r&   c                    [        U R                  [        5      (       ab  [        U R                  [        5      (       d  [	        S5      eU R
                  R                  5        SU R                  R                  5        S3$ U R                  (       a/  U R
                  R                  5        SU R                  5       < S3$ [        U R                  [        R                  5      (       aP  U R
                  R                  5        S[        U R                  U R                  5       R                  5       5       S3$ U R
                  R                  5        SU R                  < S3$ )NzBGetItemSource index must be a constant, enum or ConstDictKeySourcerC  r9   )r   r   r   ConstDictKeySource
ValueErrorr   r;   r$   r"   enumEnumr   r   is_localr6   s    r   r;   GetItemSource.name  s    djj&))djj*<== X  iinn&'q):(;1==  iinn&'q):):)<(?qAA

DII..iinn&'q4::t?P?P?R?[?[?])^(__`aaiinn&'qa88r&   r=   )r>   r?   r@   rA   r   rC   r$   rD   r   r   r   r"   r;   rE   __classcell__)rQ  s   @r   r   r     s1    J ND 8C((
9 9r&   r   c                   &    \ rS rSrS rS rS rSrg)r]  i  c                     gr   r=   r6   s    r   is_dict_keyConstDictKeySource.is_dict_key	  r   r&   c                    ^ TR                  U4S j5        U R                  R                  T5        TR                  TR	                  U R
                  5      5        TR                  [        SS5      5        g )Nc                  D   > T R                  [        R                  S5      $ )Ndict_keys_getitemr   r
   r>   r#   s   r   r}   0ConstDictKeySource.reconstruct.<locals>.<lambda>  s    G,,U^^=PQr&   r   Fr   r   r   r    r!   r   r   r   r1   s    `r   r   ConstDictKeySource.reconstruct  s[    Q	
 			g&g77

CD21e<=r&   c                 Z    SU R                   R                  5        SU R                  < S3$ )Nzlist(z	.keys())[r9   r   r;   r   r6   s    r   r;   ConstDictKeySource.name  s'    tyy~~'(	$**qAAr&   r=   N)r>   r?   r@   rA   rf  r   r;   rE   r=   r&   r   r]  r]    s    >Br&   r]  c                        \ rS rSrS rS rSrg)TupleIteratorGetItemSourcei  c                    ^ TR                  U4S j5        U R                  R                  T5        TR                  TR	                  U R
                  5      5        TR                  [        SS5      5        g )Nc                  D   > T R                  [        R                  S5      $ )Ntuple_iterator_getitemrk  rl  s   r   r}   8TupleIteratorGetItemSource.reconstruct.<locals>.<lambda>  s    G,,U^^=UVr&   r   Frn  r1   s    `r   r   &TupleIteratorGetItemSource.reconstruct  s[    V	
 			g&g77

CD21e<=r&   c                 Z    SU R                   R                  5        SU R                  < S3$ )Nz___tuple_iterator_getitem(r   r   rq  r6   s    r   r;   TupleIteratorGetItemSource.name#  s'    +DIINN,<+=R

~QOOr&   r=   N)r>   r?   r@   rA   r   r;   rE   r=   r&   r   rt  rt    s    >Pr&   rt  c                   ,    \ rS rSrS rS rS rS rSrg)
TypeSourcei'  c                 "    U R                   c   eg r   r  r6   s    r   r   TypeSource.__post_init__)  r	  r&   c                    ^ TR                  U4S j5        U R                  R                  T5        TR                  [	        SS5      5        g )Nc                  (   > T R                  SS5      $ )Nbuiltinstyper   rl  s   r   r}   (TypeSource.reconstruct.<locals>.<lambda>-  s    g&>&>z6&Rr&   r	   Fr   r   r   r   r   r1   s    `r   r   TypeSource.reconstruct,  s:    RS		g&21e<=r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   TypeSource.guard_source1  r   r&   c                 >    SU R                   R                  5        S3$ )Nztype(r   r   r6   s    r   r;   TypeSource.name4  s    tyy~~'(**r&   r=   Nr  r=   r&   r   r}  r}  '  s    %>
(+r&   r}  c                   8    \ rS rSr% \\S'   S rS rS rS r	Sr
g)	r   i8  r   c                 "    U R                   c   eg r   r  r6   s    r   r    ODictGetItemSource.__post_init__<  r	  r&   c                 |   ^ TR                  U4S j5        [        U TSS9  TR                  [        SS5      5        g )Nc                  t   > T R                  T R                  [        R                  R                  5      5      $ r   )r    create_load_const_uncheckedcollectionsOrderedDict__getitem__rl  s   r   r}   0ODictGetItemSource.reconstruct.<locals>.<lambda>A  s*    G))33K4K4K4W4WXr&   FrT  r   )r   r%   r   r   r1   s    `r   r   ODictGetItemSource.reconstruct?  s:    	

 	D'%@21e<=r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   ODictGetItemSource.guard_sourceH  r   r&   c                    [        U R                  [        5      (       aQ  SU R                  R                   SU R                  R                   3nSU R
                  R                  5        SU S3$ [        U R                  [        5      (       a9  SU R
                  R                  5        SU R                  R                  5        S3$ SU R
                  R                  5        SU R                  < S3$ )Nz__load_module("z").z___odict_getitem(r   r   )r   r   r  r?   r@   r   r;   r   )r2   reps     r   r;   ODictGetItemSource.nameK  s    djj$''#DJJ$9$9#:#djj>U>U=VWC&tyy~~'7&83%qAA

F++&tyy~~'7&84::??;L:MQOO&tyy~~'7&84::.JJr&   r=   N)r>   r?   r@   rA   r   rC   r   r   r   r;   rE   r=   r&   r   r   r   8  s    J%>(Kr&   r   c                   &    \ rS rSrS rS rS rSrg)OptimizerSourceiU  c                 :    U R                   R                  U5        g r   r   r1   s     r   r   OptimizerSource.reconstructW  r  r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   OptimizerSource.guard_sourceZ  r   r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r;   OptimizerSource.name]      yy~~r&   r=   Nr   r=   r&   r   r  r  U  s    '( r&   r  c                   &    \ rS rSrS rS rS rSrg)NNModuleSourceia  c                 :    U R                   R                  U5        g r   r   r1   s     r   r   NNModuleSource.reconstructc  r  r&   c                 D    [         U R                  R                  5          $ r   r   r6   s    r   r   NNModuleSource.guard_sourcef  r   r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r;   NNModuleSource.namei  r  r&   r=   Nr   r=   r&   r   r  r  a  s    'M r&   r  c                       \ rS rSrS rSrg)UnspecializedNNModuleSourceim  c                 D    [         U R                  R                  5          $ r   )%_GUARD_SOURCE_UNSPECIALIZED_NN_MODULEr   r   r6   s    r   r   (UnspecializedNNModuleSource.guard_sourceo  s    4TYY5K5K5MNNr&   r=   Nr   r=   r&   r   r  r  m  s    Or&   r  c                       \ rS rSrS rSrg)"UnspecializedBuiltinNNModuleSourceis  c                 D    [         U R                  R                  5          $ r   )-_GUARD_SOURCE_UNSPECIALIZED_BUILTIN_NN_MODULEr   r   r6   s    r   r   /UnspecializedBuiltinNNModuleSource.guard_sourceu  s    <TYY=S=S=UVVr&   r=   Nr   r=   r&   r   r  r  s  s    Wr&   r  c                       \ rS rSrS rSrg)FSDPNNModuleSourceiy  c                 D    [         U R                  R                  5          $ r   )_GUARD_SOURCE_FSDP_MODULEr   r   r6   s    r   r   FSDPNNModuleSource.guard_source{  s    ()?)?)ABBr&   r=   Nr   r=   r&   r   r  r  y  s    Cr&   r  c                        \ rS rSrS rS rSrg)GlobalStateSourcei  c                     gNr   r=   r6   s    r   r;   GlobalStateSource.name      r&   c                 "    [         R                  $ r   ro   r6   s    r   r   GlobalStateSource.guard_source  rr   r&   r=   Nr>   r?   r@   rA   r;   r   rE   r=   r&   r   r  r    s    "r&   r  c                   8    \ rS rSr% \\S'   S rS rS rS r	Sr
g)	TorchFunctionModeStackSourcei  indc                 *    SU R                  5        S3$ )Nz$___get_torch_function_mode_stack_at(r   )
_get_indexr6   s    r   r;   !TorchFunctionModeStackSource.name  s    5doo6G5HJJr&   c                 D    SSK Jn  UR                  U R                  5      $ )Nr	   )TorchFunctionModeStackVariable)variables.torch_functionr  get_mode_indexr  )r2   r  s     r   r  'TorchFunctionModeStackSource._get_index  s    L-<<TXXFFr&   c                    ^ TR                  U4S j5        TR                  TR                  U R                  5       5      /5        TR                  [	        SS5      5        g )Nc                  D   > T R                  [        R                  S5      $ )N get_torch_function_mode_stack_atrk  rl  s   r   r}   :TorchFunctionModeStackSource.reconstruct.<locals>.<lambda>  s    G,, Br&   r	   F)r   r   r!   r  r   r1   s    `r   r   (TorchFunctionModeStackSource.reconstruct  sQ    	

 	w889JKLM21e<=r&   c                 "    [         R                  $ r   ro   r6   s    r   r   )TorchFunctionModeStackSource.guard_source  rr   r&   r=   N)r>   r?   r@   rA   rb   rC   r;   r  r   r   rE   r=   r&   r   r  r    s    	HKG
>"r&   r  c                   8    \ rS rSr% \\S'   S rS rS rS r	Sr
g)	r   i  source_namec                 V    UR                  UR                  U R                  SS95        g )NFri   )r    rl   r  r1   s     r   r   ConstantSource.reconstruct  s&    g889I9Iu8UVr&   c                 "    [         R                  $ r   )r   r   r6   s    r   r   ConstantSource.guard_source  s    ###r&   c                     U R                   $ r   )r  r6   s    r   r;   ConstantSource.name  s    r&   c                     [         er   r   r   s     r   r   ConstantSource.make_guard  r   r&   r=   N)r>   r?   r@   rA   rB   rC   r   r   r;   r   rE   r=   r&   r   r   r     s    W$ "r&   r   c                   .    \ rS rSrS\4S jrS rS rSrg)NumpyTensorSourcei  returnc                 >    SU R                   R                  5        S3$ )Nz___from_numpy(r   r   r6   s    r   r;   NumpyTensorSource.name  s    		 0133r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   NumpyTensorSource.guard_source  r   r&   c                    ^ TR                  U4S j5        U R                  R                  T5        TR                  [	        SS5      5        g )Nc                  (   > T R                  SS5      $ )Ntorch	as_tensorr  rl  s   r   r}   /NumpyTensorSource.reconstruct.<locals>.<lambda>  s    g&>&>w&Tr&   r	   Fr  r1   s    `r   r   NumpyTensorSource.reconstruct  s:    TU		g&21e<=r&   r=   N)	r>   r?   r@   rA   rB   r;   r   r   rE   r=   r&   r   r  r    s    4c 4(>r&   r  c                   (    \ rS rSrS\4S jrS rSrg)SubclassAttrListSourcei  r  c                 <    U R                   R                  5        S3$ )Nz.__tensor_flatten__()[0]r   r6   s    r   r;   SubclassAttrListSource.name  s    )).."##;<<r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   #SubclassAttrListSource.guard_source  r   r&   r=   Nr>   r?   r@   rA   rB   r;   r   rE   r=   r&   r   r  r    s    =c =(r&   r  c                   (    \ rS rSrS\4S jrS rSrg)FloatTensorSourcei  r  c                 >    SU R                   R                  5        S3$ )Nz___as_tensor(r   r   r6   s    r   r;   FloatTensorSource.name  s    tyy~~/022r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   FloatTensorSource.guard_source  r   r&   r=   Nr  r=   r&   r   r  r    s    3c 3(r&   r  c                   (    \ rS rSrS\4S jrS rSrg)CallMethodItemSourcei  r  c                 <    U R                   R                  5        S3$ )Nz.item()r   r6   s    r   r;   CallMethodItemSource.name  s    )).."#7++r&   c                 6    U R                   R                  5       $ r   r   r6   s    r   r   !CallMethodItemSource.guard_source  r   r&   r=   Nr  r=   r&   r   r  r    s    ,c ,(r&   r  c                        \ rS rSrS rS rSrg)ShapeEnvSourcei  c                     gr  r=   r6   s    r   r;   ShapeEnvSource.name  r  r&   c                 "    [         R                  $ r   )r   	SHAPE_ENVr6   s    r   r   ShapeEnvSource.guard_source  r   r&   r=   Nr  r=   r&   r   r  r    s    %r&   r  c                        \ rS rSrS rS rSrg)BackwardStateSourcei  c                     gr  r=   r6   s    r   r;   BackwardStateSource.name  r  r&   c                 "    [         R                  $ r   )r   BACKWARD_STATEr6   s    r   r    BackwardStateSource.guard_source  s    )))r&   r=   Nr  r=   r&   r   r	  r	    s    *r&   r	  Fonly_allow_inputc                    [        U [        5      (       a  [        U R                  US9$ [        U [        5      (       d  gU(       a  U R
                  (       d  gg)Nr  FT)r   r   is_from_local_sourcer   r)   r,   )r   r  s     r   r  r    s@    &-((#FKKBRSSfk**r&   c                     [        U [        5      (       a  g[        U [        5      (       a  [        U R                  5      $ gr   )r   r   r   )is_from_unspecialized_param_buffer_sourcer   r   s    r   r  r    s2    &899&-((8EEr&   c                     [        U [        5      (       a  g[        U [        5      (       a  [        U R                  5      $ gr   )r   r  r   $is_from_flatten_script_object_sourcer   r   s    r   r  r    s2    &344	FM	*	*3FKK@@r&   c                     [        U [        5      (       a  g[        U [        5      (       a  [        U R                  5      $ gr   )r   r  r   is_from_optimizer_sourcer   r   s    r   r  r    s1    &/**&-(('44r&   c                     [        U [        5      (       a  g[        U [        5      (       a  [        U R                  5      $ gr   )r   r9  r   is_from_defaultsr   r   s    r   r  r    s1    &.))&-((,,r&   )Pr  rK  r_  typingr   r   r   torch._guardsr   r   r   r   r
   bytecode_transformationr   r   r   r5   LOCAL_SPECIALIZED_NN_MODULErp   GLOBAL_SPECIALIZED_NN_MODULELOCAL_UNSPECIALIZED_NN_MODULEGLOBAL_UNSPECIALIZED_NN_MODULE%LOCAL_UNSPECIALIZED_BUILTIN_NN_MODULE&GLOBAL_UNSPECIALIZED_BUILTIN_NN_MODULELOCAL_FSDP_MODULEGLOBAL_FSDP_MODULEr   r  r  r  r   r%   	dataclassr)   rG   rR   rd   rx   r   r   r   r   r   r   r   r   r`  r   r   r  r  r  r'  r1  r9  r   r]  rt  r}  r   r  r  r  r  r  r  r  r   r  r  r  r  r  r	  r  r  r  r  r  r=   r&   r   <module>r'     s/	      ' ' < <  M  {>>@@++[-T-T,,k.V.V--{/X/X..0Z0Z55{7h7h668j8j!!;#@#@""K$B$B' #  {@@BB--{/X/X..0Z0Z++[-V-V,,k.X.X55{7h7h668j8j!!;#@#@""K$B$B) %" {HHJJ--{/`/`..0b0b++[-^-^,,k.`.`55{7h7h668j8j!!;#@#@""K$B$B1 - {4466++[-J-J,,k.L.L!!;#@#@""K$B$B--{/L/L..0N0N55{7T7T668V8V 	K78K d#-& - $-0 d#
76 
7 $
7 d#8 8 $8 d#
.6 
. $
. d#0& 0 $0$ d#	' 	' $	' d#	0 	 $	 d#3 3 $32 d#Lf L $L, d#3 3 $3 d#M
 M $M d#	Z 	 $	 d#f  $ $TYY $ d#%;= %; $%;P d#/= / $/ d#G} G $G d#7 7 $7 d#>m > $>0m 0 d#!] ! $!H d#(9M (9 $(9V d#B B $B" d#
P 
P $
P d#+ + $+  d#K K $K8 d# m   $  d# ]   $  d#O. O $O
 d#W)D W $W
 d#C C $C
 d#" " $" d#"6 " $"0 d#"V " $"  d#
> 
> $
> d#(] ( $( d#( ( $( d#(= ( $( d#%V % $% d#*& * $* >C  f  V V r&   