
    ȅiJ                     X   % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKJrJrJr  SSKJrJrJrJrJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SS	KJr  S
SK J!r!J"r"J#r#J$r$  S
SK%J&r&J'r'J(r(J)r)  S
SK*J+r+J,r,J-r-  S
SK
J.r.J/r/J0r0  S
SK1J2r2J3r3  Sr4\\
Rj                     \6S'    SSK7r4\"Rr                  r9Sr:\Rv                  " \<5      r=\" S5      r>S\\R~                     S\\R~                     4S jr@S\AS\A4S jrBS rCS rDS\R                  R                  S\S\S\S\G\   4
S jrHS\S\I4S  jrJ\S\R~                  S\R~                  4S! j5       rK\S\\G\   \L\S"4   \M\\4   4   S\N4S# j5       rKS\S\\R~                  \N4   4S$ jrKS\A4S% jrOSpS\AS&\
R                  S'\ASS4S( jjrQSS).S*\/S+\RS,\S-\S.\RS\.4S/ jjrS " S0 S15      rT " S2 S35      rU " S4 S55      rV " S6 S75      rW " S8 S95      rXS&\AS\A4S: jrYS&\AS\A4S; jrZS&\AS\A4S< jr[S=\AS\A4S> jr\S&\AS\A4S? jr]   SqS@\SA\S"\4   SB\RSC\\R   SD\\R   SE\RSS4SF jjr^SG\R                  S\G\R~                     S\S"\4   4SH jr`  SrSI\NSJ\NSK\ISL\NS\A4
SM jjra\R                  SNS4SO\\R   SP\\R   SQ\R                  SR\\A\R                  4   SS\RS\R~                  4ST jjre\" SU5      rfS\I4SV jrgSA\\>\f4   SW\S\\>\f4   4SX jrhSSY SZ.S[\iS\\AS]\ASW\S^\\A   S_\\S"\4   /\S"\4   4   S\i4S` jjrjSA\\>\f4   S\\>\f4   4Sa jrkSA\\>\f4   S\\>\f4   4Sb jrlSA\\>\f4   S\\>\f4   4Sc jrmSA\\>\f4   S\\>\f4   4Sd jrnSA\\>\f4   S\\>\f4   4Se jroSA\\>\f4   S\\>\f4   4Sf jrpSA\\>\f4   S\\>\f4   4Sg jrqSA\\>\f4   S\\>\f4   4Sh jrrSsSi\ISS4Sj jjrsSk\\>\f4   Sl\>R                  Sm\>R                  S\f4Sn jrvSqw\R                  S\\G\R6                  R                        4So j5       ryg! \8 a    Sr4 GNuf = f)ta1  Testing utilities and infrastructure for Dynamo.

This module provides a comprehensive set of testing utilities including:
- Test result collection and validation
- Graph manipulation and comparison tools
- Test case management and execution helpers
- Specialized test decorators for different Python versions and features
- RNG state management
- Compilation counting and monitoring
- Debug utilities for bytecode transformation

The utilities in this module are used across Dynamo's test suite to ensure
consistent testing patterns and proper test isolation.
    N)Callable	GeneratorSequence)AnyOptionaloverloadTypeVarUnion)	ParamSpec)patch)fx)	aot_eager)OutputGraph   )config
eval_frameoptimize_assertreset)create_instructiondebug_checksis_generatortransform_code_object)CheckFunctionManager	CompileIdGuardedCode)ConvertFrameReturnDynamoFrameTypewrap_guarded_code)CompileCounterIntsamenp   _Pxreturnc                 x    U c  g U R                  5       R                  5       R                  U R                  5      $ N)detachclonerequires_grad_requires_gradr$   s    O/home/james-whalen/.local/lib/python3.13/site-packages/torch/_dynamo/testing.pyclone_mer.   ?   s.    y88:,,Q__==    namec                 2    [         R                  " SSU 5      $ )Nz^_orig_mod[.] resub)r0   s    r-   remove_optimized_module_prefixr6   E       66"B--r/   c                    ^^^ SSK Jm  S mS mUUU4S jn[        R                  " USS9" U 5      " U0 UD6  TR                  T4$ )Nr   )InstructionTranslatorc                 T   > U mTR                  5       R                  R                  mU $ r'   )
current_txoutputregion_tracker)_gmargskwargsr9   gmr=   s      r-   extract_graph_backend8extract_graph_and_tracker.<locals>.extract_graph_backendO   s)     .99;BBQQ
r/   T)backend	fullgraph)torch._dynamo.symbolic_convertr9   torchcompilegraph)fnr?   r@   rB   r9   rA   r=   s       @@@r-   extract_graph_and_trackerrK   I   sD    D	BN 
MM/4@DdUfU88^##r/   c                     [        5       n[        R                  " US9" U 5      " U0 UD6nXCR                  UR                  UR
                  4$ )N)rD   )AotEagerAndRecordGraphsrG   rH   graphs	fw_graphs	bw_graphs)rJ   r?   r@   rD   results        r-   extract_graphrR   Z   sD    %'G]]7+B/@@F>>7#4#4g6G6GGGr/   model
predictionlossexample_inputsc                 @   / nUR                  U5        UR                  U5        0 n0 nU R                  5        Hk  u  px[        U [        R                  5      (       a  [        U5      nUn	UR                  n
UR                  c  [        R                  " U5      n
XUS-   '   XU'   Mm     UR                  U5        UR                  U5        0 nU R                  5        H3  u  p|[        U [        R                  5      (       a  [        U5      nXU'   M5     UR                  U5        U Ht  n[        U[        [        45      (       a  UR                  S U 5       5        M8  [        U[        R                  5      (       d  MY  UR                  UR                  5        Mv     U$ )Nz.gradc              3   |   #    U  H2  n[        U[        R                  5      (       d  M$  UR                  v   M4     g 7fr'   )
isinstancerG   Tensorgrad).0inps     r-   	<genexpr>"collect_results.<locals>.<genexpr>   s#     Xw*S%,,:W8388ws   #<<)appendnamed_parametersrY   r   OptimizedModuler6   r[   rG   
zeros_likenamed_bufferstuplelistextendrZ   )rS   rT   rU   rV   resultsgradsparamsr0   param
param_copyr[   buffersbufferexamples                 r-   collect_resultsrp   `   sU    GNN:NN4 EF--/eZ77881$7D
zz::##E*D $dWn!t 0 NN5NN6G++-eZ77881$7D . NN7!gt}--NNXwXX'5<<00w||, " Nr/   outc                    [        U [        R                  5      (       a  U R                  $ [        U [        [
        45      (       a  [        S U  5       5      $ U c  g[        U [        5      (       a  g[        S[        U 5      5      e)Nc              3   8   #    U  H  n[        U5      v   M     g 7fr'   )requires_bwd_passr\   r$   s     r-   r^   $requires_bwd_pass.<locals>.<genexpr>   s     5A$Q''   FDon't know how to reduce)
rY   rG   rZ   r+   rf   re   anyintNotImplementedErrortyperq   s    r-   rt   rt      sk    #u||$$   	C$	'	'5555		C		
8$s)
DDr/   c                     g r'    r}   s    r-   reduce_to_scalar_lossr      s    >Ar/   .c                     g r'   r   r}   s    r-   r   r      s     r/   c                 ~   [        U [        R                  5      (       a!  U R                  5       U R	                  5       -  $ [        U [
        [        45      (       a  [        S U  5       5      [        U 5      -  $ [        U 5      R                  S;   a  [        U R                  5      $ [        U 5      R                  S:X  a  U R                  R                  5       $ [        U [        5      (       a:  [        S U R                  5        5       5      [        U R                  5       5      -  $ [!        S[        U 5      5      e)z/Reduce the output of a model to get scalar lossc              3   8   #    U  H  n[        U5      v   M     g 7fr'   r   ru   s     r-   r^   (reduce_to_scalar_loss.<locals>.<genexpr>   s     9S(++Srw   )MaskedLMOutputSeq2SeqLMOutput!CausalLMOutputWithCrossAttentionsSquashedNormalc              3   8   #    U  H  n[        U5      v   M     g 7fr'   r   )r\   values     r-   r^   r      s     J\E(//\rw   rx   )rY   rG   rZ   sumnumelrf   re   lenr|   __name__r   logitsmeandictvalueskeysr{   r}   s    r-   r   r      s    #u||$$wwy399;&&	C$	'	'9S99CHDD	c		   

 %SZZ00	c		/	/xx||~	C		JSZZ\JJSHHJN
 
 	
 8$s)
DDr/   c                      [         R                  R                  [         R                  R                  [        5      S5      n [         R                  R                  U 5      (       d  [         R                  " U 5        U $ )Nz../debug)ospathjoindirname__file__existsmkdir)r   s    r-   	debug_dirr      sF    77<<1:>D77>>$
Kr/   codeextrac           	      X   [        [        R                  R                  [	        5       U 5      S5       nUR                  [        R                  " U5      R                  5        S[        R                  " U5      R                  5        SU S35        S S S 5        g ! , (       d  f       g = f)Nwz


)	openr   r   r   r   writedisBytecodeinfo)r0   r   r   fds       r-   
debug_dumpr      st    	bggll9;-s	3r
||D!&&()cll4.@.D.D.F-GtE7RTU	
 
4	3	3s   AB
B))skipframe
cache_sizehooks_r   c                   S[         [           S[        SS4S jn[        R                  R                  R                  5       n[        R                  R                  R                  S5         U   [        U R                  5      (       a  [        5       sSSS5        sSSS5        $ [        U R                  5        [        U R                  U5      u  ps[        0 SSS/ SS	0[        5       [        5       U R                  / SS
9n[        [!        U[#        U R                  U5      R$                  ['        S	S	S95      5      sSSS5        sSSS5        $ ! , (       d  f       O= fSSS5        g! , (       d  f       g= f)zused to debug jump updatesinstructionscode_optionsr%   Nc                 p    U R                  S[        S5      5        U R                  S[        S5      5        g )Nr   NOP)insertr   )r   r   s     r-   insert_nops&debug_insert_nops.<locals>.insert_nops   s.    A1%89A1%89r/   debug_insert_nopsF_idr   )r   compiler_fnroot_txexportexport_constraintsframe_statelocal_scopeglobal_scopef_codetorch_function_mode_stackpackage)frame_idframe_compile_id)rf   r   rG   _dynamoutilsget_metrics_contextdynamo_timedr   r   r   r   r   r   localsglobalsr   r   r   guard_managerr   )	r   r   r   r   r   r   metrics_contextr   rI   s	            r-   r   r      s!   
:$s) :3 :4 : mm))==?O				)	)*=	>%%%' AP	>	> 	U\\"'kB!
 <<&(
 !$U\\59GG1q9
+ AP	>	>	>	>	>s1   ,E*/$E	E*&BE=	E*
E	E**
E8c                       \ rS rSrSS jrS\R                  R                  S\\R                     S\
S\4   4S jrSS	 jrS
rg)CompileCounter   r%   Nc                 2    SU l         U R                  5         g Nr   )frame_countclearselfs    r-   __init__CompileCounter.__init__   s    :;

r/   rA   rV   .c                     U =R                   S-  sl         UR                  R                   H*  nSUR                  ;   d  M  U =R                  S-  sl        M,     UR
                  $ )Nr   call)r   rI   nodesopop_countforward)r   rA   rV   nodes       r-   __call__CompileCounter.__call__   sM     	AHHNND " # zzr/   c                 l    [         R                  (       a  [        S5      U l        OSU l        SU l        g r   )r   debug_disable_compile_counterr   r   r   r   s    r-   r   CompileCounter.clear   s'    //03D Dr/   )r   r   r%   N)r   
__module____qualname____firstlineno__r   rG   r   GraphModulerf   rZ   r   r   r   r   __static_attributes__r   r/   r-   r   r      sE    ((&&8<U\\8J	#s(	r/   r   c                       \ rS rSrS\SS4S jrS\R                  R                  S\	\R                     S\S\4   4S	 jrSS
 jrSrg)CompileCounterWithBackend   rD   r%   Nc                 L    SU l         Xl        / U l        U R                  5         g r   )r   rD   rN   r   )r   rD   s     r-   r   "CompileCounterWithBackend.__init__  s    :;24

r/   rA   rV   .c                 &   SSK Jn  U =R                  S-  sl        UR                  R                   H*  nSUR
                  ;   d  M  U =R                  S-  sl        M,     U R                  R                  U5        U" U R                  5      " X5      $ )Nr   )lookup_backendr   )
backends.registryr   r   rI   r   r   r   rN   r`   rD   )r   rA   rV   r   r   s        r-   r   "CompileCounterWithBackend.__call__  sl     	6AHHNND " # 	2dll+B??r/   c                 z    [         R                  (       a  [        S5      U l        OSU l        SU l        / U l        g r   )r   r   r   r   r   rN   r   s    r-   r   CompileCounterWithBackend.clear  s.    //03D Dr/   )rD   r   rN   r   r   )r   r   r   r   strr   rG   r   r   rf   rZ   r   r   r   r   r   r   r/   r-   r   r      sW      
@((&&
@8<U\\8J
@	#s(	
@r/   r   c                       \ rS rSrS
S jrS\R                  R                  S\\R                     S\
S\4   4S jrS	rg)EagerAndRecordGraphsi  r%   Nc                     / U l         g r'   rN   r   s    r-   r   EagerAndRecordGraphs.__init__  s	    24r/   rA   rV   .c                 P    U R                   R                  U5        UR                  $ r'   )rN   r`   r   )r   rA   rV   s      r-   r   EagerAndRecordGraphs.__call__"  s      	2zzr/   r   r   r   r   r   r   r   rG   r   r   rf   rZ   r   r   r   r   r   r/   r-   r   r     s@    5((&&8<U\\8J	#s(	r/   r   c                       \ rS rSrS
S jrS\R                  R                  S\\R                     S\
S\4   4S jrS	rg)rM   i)  r%   Nc                 .    / U l         / U l        / U l        g r'   )rN   rO   rP   r   s    r-   r    AotEagerAndRecordGraphs.__init__*  s    245757r/   rA   rV   .c                 r  ^  T R                   R                  U5        S[        R                  R                  S[
        [        R                     S[        S[        4   4U 4S jjnS[        R                  R                  S[
        [        R                     S[        S[        4   4U 4S jjn[        UUUUS9$ )NrA   rV   r%   .c                 R   > TR                   R                  U 5        U R                  $ r'   )rO   r`   r   rA   rV   r   s     r-   fw_compiler5AotEagerAndRecordGraphs.__call__.<locals>.fw_compiler4  !     NN!!"%::r/   c                 R   > TR                   R                  U 5        U R                  $ r'   )rP   r`   r   r  s     r-   bw_compiler5AotEagerAndRecordGraphs.__call__.<locals>.bw_compiler:  r  r/   )r  r  )
rN   r`   rG   r   r   rf   rZ   r   r   r   )r   rA   rV   r  r  s   `    r-   r    AotEagerAndRecordGraphs.__call__/  s     	2	$$	6:5<<6H	c3h		$$	6:5<<6H	c3h	 ##	
 	
r/   )rP   rO   rN   r   r   r   r/   r-   rM   rM   )  s@    8

((&&
8<U\\8J
	#s(	
r/   rM   c                   $    \ rS rSrSS jrS rSrg)InductorAndRecordGraphsiH  Nc                      / U l         / U l        g r'   rN   inductor_graphsr   s    r-   r    InductorAndRecordGraphs.__init__I  s    24;=r/   c                    ^ ^ SS K Js  Jn  T R                  R	                  U5        UR
                  mUU 4S jn[        R                  " USUS9   UR                  X5      sS S S 5        $ ! , (       d  f       g = f)Nr   c                  P   > TR                   R                  U S   5        T" U 0 UD6$ r   )r  r`   )r?   r@   old_compile_fx_innerr   s     r-   patched1InductorAndRecordGraphs.__call__.<locals>.patchedT  s+      ''Q0'888r/   _compile_fx_inner)new)torch._inductor.compile_fx	_inductor
compile_fxrN   r`   r  r   object)r   rA   rV   compile_fx_modr  r  s   `    @r-   r    InductorAndRecordGraphs.__call__M  sZ    ;;2-??	9 \\.*=7K!,,R@ LKKs   A++
A9r  r   )r   r   r   r   r   r   r   r   r/   r-   r  r  H  s    >Ar/   r  c                 2    [         R                  " SSU 5      $ )Nz(?m)^ *#.*\n?r2   r3   )r   s    r-   strip_commentr  \  r7   r/   c                     SR                  U R                  S5       Vs/ s H  oR                  5       PM     sn5      $ s  snf )Nr   )r   splitrstrip)r   lines     r-   remove_trailing_spacer$  `  s2    99

40@A0@kkm0@ABBAs   ?c                     U R                  S5      n/ nSnU H6  nUR                  5       S:X  a  U(       a  M   SnOSnUR                  U5        M8     SR                  U5      $ )Nr   Fr2   T)r!  stripr`   r   )r   linesrQ   	saw_blankr#  s        r-   _squash_blank_linesr)  d  s_    JJtEFI::<2IId  99Vr/   gm_strc                 D    [        U 5      n[        U5      n[        U5      $ r'   )r  r$  r)  )r*  strippedno_trailings      r-   normalize_gmr.  s  s#     V$H'1K{++r/   c                 6    [         R                  " SSU 5      nU$ )z%
Normalize code: remove empty lines.
z[\r\n]+r   r3   )r   normal_codes     r-   empty_line_normalizerr1  {  s     &&T40Kr/   r   rJ   nargsexpected_opsexpected_ops_dynamicexpected_frame_countc                    [         R                  (       d  Ub  Un[        5       n[        U5       Vs/ s H  n[        R
                  " SS5      PM     nn[        U5       Vs/ s H  n[        R
                  " SS5      PM     n	nU" U6 n
U" U	6 n[        5         [        U5      " U5      nU" U6 nU" U	6 nU" U6 nU" U	6 n[        5         U R                  [        X5      5        U R                  [        X5      5        U R                  [        X5      5        U R                  [        UU5      5        U R                  UR                  U5        Ub  U R                  UR                  U5        g g s  snf s  snf )N
   )r   assume_static_by_defaultr   rangerG   randnr   r   
assertTruer    assertEqualr   r   )r   rJ   r2  r3  r4  r5  actualr   args1args2correct1correct2opt_fnval1aval2aval1bval2bs                    r-   standard_testrG    s9    **/C/O+F*/,7,QU[[R ,E7*/,7,QU[[R ,E75zH5zH	GV$R(FENEENEENEENE	GOOD)*OOD)*OOD)*OOD)*V'')=>,7  ! 87s   !E."!E3rA   c                     U R                   $ r'   )r   )rA   rV   s     r-   dummy_fx_compilerI    s     ::r/   speeduppvalue
is_correctpvalue_thresholdc                 :    U(       d  gX:  a  U S S3$ U S SUS 3$ )NERRORz.3fzx SAMEzx p=z.2fr   )rJ  rK  rL  rM  s       r-   format_speeduprP    s4      #f%%c]$vcl++r/   cpusizestridedtypedevice
extra_sizec                    Un[        S U  5       5      (       a!  U[        S [        X5       5       5      S-   -  nUR                  (       aY  UR                  S:X  a3   [
        R                  " U[
        R                  US9R                  US9nO,[
        R                  " XRUS9nO[
        R                  " U/X#S9n[
        R                  " X`U5      $ )Nc              3   *   #    U  H	  oS :  v   M     g7f)r   Nr   )r\   ss     r-   r^   rand_strided.<locals>.<genexpr>  s     
$Qq5$s   c              3   6   #    U  H  u  pUS -
  U-  v   M     g7f)r   Nr   )r\   shaperS  s      r-   r^   rZ    s     L:Kf$:Ks   r   )rT  rU  )rT  )rR  rT  rU  )allr   zipis_floating_pointitemsizerG   r:  float16tozeros
as_strided)rR  rS  rT  rU  rV  needed_sizern   s          r-   rand_stridedrf    s     K

$
L#d:KLLqP	
 >>Q [[EMM&QTT U F [[&IF;-uLF&11r/   _Tc                  ,    [         R                  (       + $ r'   )r   r8  r   r/   r-   check_dynamic_shape_captureri    s    ....r/   patchesc                    ^ ^ [         R                  " T 5      S[        R                  S[        R                  S[
        4U U4S jj5       nU$ )Nr?   r@   r%   c            	         > [         R                  " 5        nT H,  u  p4nUR                  [        R                  " X4U5      5        M.     T" U 0 UD6sS S S 5        $ ! , (       d  f       g = fr'   )
contextlib	ExitStackenter_contextr   r  )r?   r@   stackmoduleattrvalrJ   rj  s         r-   _fn"_make_fn_with_patches.<locals>._fn  sT    !!#u%,!c##ELLs$CD &- t&v&	 $##s   :A
A))	functoolswrapsr#   r?   r@   rg  )rJ   rj  rt  s   `` r-   _make_fn_with_patchesrx    sB    __R'277 'bii 'B ' ' Jr/   c                     U $ r'   r   r,   s    r-   <lambda>rz    s    ar/   )
xfail_prop	decoratorcls
cls_prefix	fn_suffixr{  r|  c          	         [        U U R                   3U R                  0 5      nUR                  Ul        [	        U 5       H  nUR                  S5      (       a  [        X5      n[        U5      (       d  [        Xg[        X5      5        MK  U U 3n	[        U/UQ76 n
Xl        Ub&  [        X5      (       a  [        R                  " U
5      n
[        XiU" U
5      5        M  [        Xg5      (       a  M  [        Xg[        X5      5        M     U$ )Ntest_)r|   r   	__bases__r   dir
startswithgetattrcallablesetattrrx  hasattrunittestexpectedFailure)r}  r~  r  r{  r|  rj  DummyTestClassr0   rJ   new_namenew_fns              r-   make_test_cls_with_patchesr    s     ZL7KN"0"9"9NC??7###BB<<gc.@A	{+H*288F&O%'"*A*A!11&9Ni.?@..N'#*<=   r/   c                 Z    [         R                  S:  a  U $ [        R                  " U 5      $ )N)r"      sysversion_infor  r   rJ   s    r-   skipIfNotPy311r    s$    
7"	==r/   c                 f    [         R                  S:  a  U $ [        R                  " S5      " U 5      $ )Nr"      zRequires Python 3.12+r  r  s    r-   skipIfNotPy312r    s*    
7"	==01"55r/   c                     [         R                  S:  d  [         R                  S:  a  [        R                  " S5      " U 5      $ U $ )N)r"      r  zRequires Python 3.12r  r  s    r-   skipIfOnlyNotPy312r    s7    
7"c&6&6&@}}34R88Ir/   c                 Z    [         R                  S:  a  [        R                  " U 5      $ U $ )Nr  )r  r  r  r  r  s    r-   xfailIfPy312r    s&    
7"''++Ir/   c                 f    [         R                  S:  a  [        R                  " S5      " U 5      $ U $ )Nr  zNot supported in Python 3.12+r  r  s    r-   skipIfPy312r     s*    
7"}}<=bAAIr/   c                     SU l         U $ NT)_expected_failure_dynamicr  s    r-   expectedFailureDynamicr  (  s    #'B Ir/   c                     SU l         U $ r  )!_expected_failure_codegen_dynamicr  s    r-   expectedFailureCodegenDynamicr  .      +/B(Ir/   c                     SU l         U $ r  )!_expected_failure_dynamic_wrapperr  s    r-   expectedFailureDynamicWrapperr  4  r  r/   use_xlac                 $   [         R                  " S5        [        R                  " S5        [        (       a  [        R                  R                  S5        U (       a3  SS KJs  Jn  UR                  S[        UR                  5       5      5        g g )Ni9  r   )rG   manual_seedrandomseedr!   torch_xla.core.xla_modelcore	xla_modelset_rng_stater   
xla_device)r  xms     r-   reset_rng_stater  9  sZ    	d
KK	r
		t--
s2==?34 r/   fr?   r@   c                     U " U0 UD6$ r'   r   )r  r?   r@   s      r-   &_skipped_function_for_test_reconstructr  D  s     dfr/   c               #   4   #    / q  [         v   Sq g! Sq f = f7f)a@  
Context manager to capture graph modules compiled by invoke_subgraph_inductor_compile.

Usage:
    with _testing_capture_invoke_subgraph_inductor_compile_gms() as captured_gms:
        # code that triggers invoke_subgraph_inductor_compile
        pass
    # captured_gms will contain the list of captured graph modules
N)6_testing_invoke_subgraph_inductor_compile_captured_gmsr   r/   r-   5_testing_capture_invoke_subgraph_inductor_compile_gmsr  M  s&      >@:FDDAE>>s    )r2   )NNr   )Tg?)F)z__doc__rm  r   rv  loggingos.pathr   r  r4   r  typesr  collections.abcr   r   r   typingr   r   r   r	   r
   typing_extensionsr   unittest.mockr   rG   r    torch._dynamo.backends.debuggingr   torch._dynamo.output_graphr   r2   r   r   r   r   bytecode_transformationr   r   r   r   guardsr   r   r   r   r   r   r   r   r    r!   
ModuleType__annotations__numpyModuleNotFoundErrorunsupportedthree	getLoggerr   logr#   rZ   r.   r   r6   rK   rR   nnModulerf   rp   boolrt   r   re   r   floatr   CodeTyper   rz   r   r   r   r   rM   r  r  r$  r)  r.  r1  rG  r   rI  rP  float32rT  rU  rf  rg  ri  rx  r|   r  r  r  r  r  r  r  r  r  r  r?   r@   r  r  contextmanagerr  r   r/   r-   <module>r     s    
     	 
   9 9 : : '    6 2 8 8  A @ I I * "&HU %
 $$	!t_>& >8ELL+A >. . .$"H%88??%(+%36%HK%	#Y%P	E3 	E4 	E 
 Au|| A A 
 A 
	tCy%S/4S>9	:
 

Es EuU\\5-@'A E,3 
S 
 
s 
D 
 QR%
%
(+%
47%
<?%
JM%
%
P , < 
 
>A A(. . .C C Cc c , , ,   #'*. !8
8c8 8 3-	8
 #3-8 8 
8B
(,U\\(:c3h !	
,
,
, 
, 	
,
 	
,  ',2
3-2SM2 ;;2 #u||#$	2
 2 \\2: T]/T /
	hr2v. 	# 	(2r6BR 	" !%DO	  	
  #s(+,hsCx.@@A 
>xB' HRV,< 6xB' 6HRV,< 68BF+ R0@ Xb"f% (2r6*: HRV$ "b&)9 xB/ HRV4D hr2v&6 8BF;K hr2v&6 8BF;K 
5T 5d 5B "3599 :> 6 Fy		@ F Fw  	Bs   /P P)(P)