
    [Thk                        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  S SK	J
r
  S SKJrJr  S SKJrJrJr  S SKrS SKJs  Jr  S SKJrJr  S SK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(J)r)J*r*J+r+  SSK,J-r-  / SQr.\R^                  " \05      r1\" SS9 " S S5      5       r2\" SS9 " S S5      5       r3/ SQr4\" SS9 " S S5      5       r5\" SS9 " S S\55      5       r6\" SS9S 5       r7\" SS9 " S S\85      5       r9\" SS9 " S S5      5       r:\" SS9 " S  S!\:5      5       r;\" SS9 " S" S#\:5      5       r<\" SS9 " S$ S%\:5      5       r=\" H  r>S& r?\?" \>5        M     S' r@\# H  rA\@" \A5        M     S( rBS) rC/ \)Q\D" S5      P\D" S*5      P\R                  R                  P\R                  R                  P V s0 s H  n U S+ _M	     sn rHS, \H\:'   S- \H\I'   S. \H\J'   \C\H\K'   \H\J   \H\&'   \H\K   \H\%'   gs  sn f )/    N)OrderedDict)Iterator)fieldsis_dataclass)AnyCallableOptional)_fx_map_aggregate_fx_map_arg)CapturedTraceback   )compatibility)Graphmagic_methodsreflectable_magic_methods)immutable_dictimmutable_list)Argument
base_typesNodeTarget)check_for_mutable_operation)	
TracerBaseGraphAppendingTracer
TraceErrorProxy	MetaProxy	AttributeParameterProxyScopeScopeContextManagerFis_backward_compatiblec                   8   ^  \ rS rSrSrS\S\4U 4S jjrSrU =r	$ )r    ,   a  Scope object that records the module path and the module type
of a module. Scope is used to track the information of the module
that contains a Node in a Graph of GraphModule. For example::

    class Sub(torch.nn.Module):
        def forward(self, x):
            # This will be a call_method Node in GraphModule,
            # scope for this would be (module_path="sub", module_type=Sub)
            return x.transpose(1, 2)


    class M(torch.nn.Module):
        def __init__(self) -> None:
            self.sub = Sub()

        def forward(self, x):
            # This will be a call_method Node as well,
            # scope for this would be (module_path="", None)
            x = x.transpose(1, 2)
            x = self.sub(x)
            return x

module_pathmodule_typec                 :   > [         TU ]  5         Xl        X l        g N)super__init__r&   r'   )selfr&   r'   	__class__s      F/var/www/auris/envauris/lib/python3.13/site-packages/torch/fx/proxy.pyr+   Scope.__init__F   s    &&    )r&   r'   )
__name__
__module____qualname____firstlineno____doc__strr   r+   __static_attributes____classcell__r-   s   @r.   r    r    ,   s     0'C 'c ' 'r0   r    c                   D   ^  \ rS rSrSrS\S\4U 4S jjrS rS rSr	U =r
$ )	r!   L   zA context manager to track the Scope of Node during symbolic tracing.
When entering a forward function of a Module, we'll update the scope information of
the current module, and when we exit, we'll restore the previous scope information.
scopecurrent_scopec                    > [         TU ]  5         [        R                  " U5      U l        UR                  Ul        UR
                  Ul        Xl        g r)   )r*   r+   copy_prev_scoper&   r'   _scope)r,   r<   r=   r-   s      r.   r+   ScopeContextManager.__init__S   sB    
 	99U+)55)55r0   c                     U R                   $ r)   )rA   r,   s    r.   	__enter__ScopeContextManager.__enter__a   s    {{r0   c                     U R                   R                  U R                  l        U R                   R                  U R                  l        g r)   )r@   r&   rA   r'   )r,   argss     r.   __exit__ScopeContextManager.__exit__d   s5    "&"2"2">">"&"2"2">">r0   )r@   rA   )r1   r2   r3   r4   r5   r    r+   rE   rI   r7   r8   r9   s   @r.   r!   r!   L   s.    
  r0   r!   )nn_module_stacktorch_fnsource_fn_stackoriginal_aten	recomputeac_graph_idhas_backward_hook	from_nodequantization_tag_numeric_debug_handlecustompartitioner_tagarg_kwarg_valsTc                   4   \ rS rSr% \\S'   Sr\\S'   Sr\\S'   Sr	\\S'   Sr
\\S'   Sr\\S	'   \\S
'   \\\\\4   4   \S'   \\\\\4   4   \S'   \" SS9  S&S\S\S\\S4   S\\\4   S\\   S\\   S\4S jj5       r\" SS9S\SS4S j5       r\" SS9   S'S\S\S\\S4   S\\\4   S\\   S\\   S\\/S4   4S jj5       rS r\" SS9S\S\4S  j5       r\" SS9S!SS\4S" j5       r\" SS9S!SS\4S# j5       r \" SS9S!SS\4S$ j5       r!S%r"g)(r   {   graphFrecord_stack_tracescheck_mutable_operationstrace_assertsproxy_buffer_attributesforwardtraced_func_namer<   module_stacknode_name_to_scopeTr"   NkindtargetrH   .kwargsname	type_exprreturnc                 \   US:X  a  U R                   (       a  [        X#U5        U R                  R                  XX4XV5      nU R                  R
                  U R                  R                  4U R                  UR                  '   [        R                  " 5       (       a  [        R                  " 5       nUR                  S5      n	U	(       a  Xl        [         H/  n
X;   d  M
  [        R                  " X   5      UR                   U
'   M1     ["        R$                  R'                  5       S-
  nUR                  SS5      S:  a  US   S   nXR                   S'   O>U R(                  (       a-  [        R                  " U R(                  5      UR                   S	'   [*        R-                  S
U5        U$ )z
Inserts a graph node given target, args, kwargs, and name.

This method can be overridden to do extra checking, validation, or
modification of values used in node creation. For example, one might
want to disallow in-place operations from being recorded.
call_functionstack_tracer   
in_grad_fnr   grad_fn_seq_nrseq_nrrK   zcreate_node %s)r\   r   rZ   create_noder<   r&   r'   rb   rf   fx_tracebackhas_preserved_node_metaget_current_metagetrk   _COPY_META_FIELDSr?   metatorchautograd_get_sequence_nrra   logdebug)r,   rc   rd   rH   re   rf   rg   nodecurrent_metark   field
new_seq_nrs               r.   rp   TracerBase.create_node   sS   $ ?"t'D'D'f=zz%%dD$R JJ""JJ"".
		* //11+7+H+H+JL&**=9K#.  +('+yy1D'EDIIe$ + 88:Q>J a014)*:;B?
",IIh+/99T5F5F+GDII'(		"D)r0   r|   r   c                     [        X5      $ r)   )r   )r,   r|   s     r.   proxyTracerBase.proxy   s    T  r0   proxy_factory_fnc                    U R                  U5      nU R                  U5      n	[        U[        5      (       d   e[        U	[        5      (       d   eU R	                  XXXV5      n
U(       d  U R                  U
5      nOU" U
5      nU R                  (       a\  UR                  R                  (       dA  SR                  [        R                  " 5       R                  5       5      UR                  l        U$ )a7  
Create a Node from the given arguments, then return the Node
wrapped in a Proxy object.

If kind = 'placeholder', then we're creating a Node that
represents the parameter of a function. If we need to encode
a default parameter, we use the ``args`` tuple. ``args`` is
otherwise empty for ``placeholder`` Nodes.
 )
create_arg
isinstancetupledictrp   r   r[   r|   rk   joinr   extractformat)r,   rc   rd   rH   re   rf   rg   r   args_kwargs_r|   r   s               r.   create_proxyTracerBase.create_proxy   s    , %//&)%'''''4((((edNJJt$E$T*E##EJJ,B,B%'WW->-F-F-H-O-O-Q%REJJ"r0   c                    ^ [         R                  " 5       m/ SQnT(       a7  TR                  mT(       a  [        U4S jU 5       5      (       a  O	T(       a  M7  T(       d  gT$ )zN
Find the Python stack frame executing the user code during
symbolic tracing.
)
ztorch/fx/proxy.pyztorch/fx/_symbolic_trace.pyz%torch/fx/experimental/proxy_tensor.pyztorch/_ops.pyztorch/_tensor.pyztorch/utils/_python_dispatch.pyztorch/_prims_common/wrappers.pyztorch/_refs/__init__.pyz%torch/_refs/nn/functional/__init__.pyztorch/utils/_stats.pyc              3   x   >#    U  H/  nTR                   R                  R                  U5      (       + v   M1     g 7fr)   )f_codeco_filenameendswith).0fileframes     r.   	<genexpr>.TracerBase._find_user_frame.<locals>.<genexpr>  s/      HPELL,,55d;;;s   7:N)inspectcurrentframef_backall)r,   pt_filesr   s     @r.   _find_user_frameTracerBase._find_user_frame   s]     $$&
 LLE HP    e r0   ac           
      r   [         R                  [        U5      5      nUb  U" X5      $ [        U[        5      (       a  UR
                  $ [        US5      (       a  UR                  U 5      $ [        U[        5      (       ao  [        US5      (       a.  U Vs/ s H  o0R                  U5      PM     nn[        U5      " U6 $ [        U5      " U Vs/ s H  o0R                  U5      PM     sn5      $ [        U[        5      (       a!  U Vs/ s H  o0R                  U5      PM     sn$ [        U[        5      (       a  [        X5      $ [        U[        5      (       aX  [        U R                  UR                  5      U R                  UR                  5      U R                  UR                   5      5      $ [        U["        5      (       aX  [#        U R                  UR                  5      U R                  UR                  5      U R                  UR                   5      5      $ [        U[$        R&                  R(                  [$        R&                  R*                  45      (       a  U$ [-        U5      (       af  [/        U5       Vs0 s H2  nUR0                  U R                  [3        XR0                  5      5      _M4     nnU R5                  SUR6                  SU5      $ [        U/ [8        Q[:        R<                  P75      (       d  Ub  USL a  U$ [?        S[        U5       35      es  snf s  snf s  snf s  snf )z
A method that lowers the objects seen as arguments during symbolic evaluation
into Argument types that can be stored in IR.

Can be override to support more trace-specific types.
__fx_create_arg___fieldsrj    .zargument of type: ) _create_arg_bypassrt   typer   r   r|   hasattrr   r   r   listr   _create_arg_dictslicestartstopsteprangerw   _ops
OpOverloadHigherOrderOperatorr   r   rf   getattrrp   r-   r   enumEnumNotImplementedError)r,   r   handlerelemrH   r~   re   s          r.   r   TracerBase.create_arg  s   & %((a1 4##a66MQ+,,&&t,,5!!q)$$ ;<<!$-!<Aw~%7a@adOOD1a@AA4  678adOOD)a884  #D,,5!!(''  5!!(''  EJJ115::3Q3QRSSH!__ $AY&E 

DOOGAzz,BCC&   ##OQ[["fMM3Z3344	Q#XH!$6tAwi"@AAE =@8*s   L%L*
L/9L4objc                     [        S5      e)a&  Called when a proxy object is being converted to a boolean, such as
when used in control flow.  Normally we don't know what to do because
we don't know the value of the proxy, but a custom tracer can attach more
information to the graph node using create_node and can choose to return a value.
zFsymbolically traced variables cannot be used as inputs to control flowr   r,   r   s     r.   to_boolTracerBase.to_boolg  s     T
 	
r0   c                     [        S5      e)a!  Called when a proxy object is being iterated over, such as
when used in control flow.  Normally we don't know what to do because
we don't know the value of the proxy, but a custom tracer can attach more
information to the graph node using create_node and can choose to return an iterator.
aH  Proxy object cannot be iterated. This can be attempted when the Proxy is used in a loop or as a *args or **kwargs function argument. See the torch.fx docs on pytorch.org for a more detailed explanation of what types of control flow can be traced, and check out the Proxy docstring for help troubleshooting Proxy iteration errorsr   r   s     r.   iterTracerBase.iterr  s     %	
 		
r0   c                 $    [        US5      " 5       $ )zCalled when a proxy object is has the keys() method called.
This is what happens when ** is called on a proxy. This should return an
iterator it ** is suppose to work in your custom tracer.
keysr   r   s     r.   r   TracerBase.keys  s     f%''r0   r   NN)NNN)#r1   r2   r3   r4   r   __annotations__r[   boolr\   r]   r^   r`   r6   r    r   r   r   r   r   r   r   r   r	   r   rp   r   r   r   r   r   r   r   r   r   r7   r   r0   r.   r   r   {   sY   L %% &+d*M4$)T) &c% L c5c?233 S%T	"2233$/ ##';; ; HcM"	;
 S(]#; sm; C=; 
; 0;z $/!$ !7 ! 0! $/ ##'6:$$ $ CHo	$
 S#X$ sm$ C=$ #D67?3$ 0$L D $/EBC EBH EB 0EBN $/
7 
t 
 0
 $/
 
H 
 0
" $/( (C ( 0(r0   r   c                   0   ^  \ rS rSrS\4U 4S jjrSrU =r$ )r   i  rZ   c                    > [         TU ]  5         Xl        [        SS 5      U l        [
        R                  " 5       U l        0 U l        g )Nr   )	r*   r+   rZ   r    r<   collectionsr   ra   rb   )r,   rZ   r-   s     r.   r+   GraphAppendingTracer.__init__  s9    
2t_
'335"$r0   )rZ   ra   rb   r<   )r1   r2   r3   r4   r   r+   r7   r8   r9   s   @r.   r   r     s    %e % %r0   r   c                     U (       d   eg r)   r   xs    r.   	assert_fnr     s	    H1r0   c                       \ rS rSrSrg)r   i  r   N)r1   r2   r3   r4   r7   r   r0   r.   r   r     s    r0   r   c                       \ rS rSrSr\" SS9SS\SS4S	 jj5       rS
\4S jr	SS jr
S
\4S jrS
\4S jrS rSS jrS
\S    4S jrS rS
\4S jr\" SS9S 5       rS r\SS j5       rSrg)r   i  a<  
``Proxy`` objects are ``Node`` wrappers that flow through the
program during symbolic tracing and record all the operations
(``torch`` function calls, method calls, operators) that they touch
into the growing FX Graph.

If you're doing graph transforms, you can wrap your own ``Proxy``
method around a raw ``Node`` so that you can use the overloaded
operators to add additional things to a ``Graph``.

``Proxy`` objects cannot be iterated. In other words, the symbolic
tracer will throw an error if a ``Proxy`` is used in a loop or as
an ``*args``/``**kwargs`` function argument.

There are two main ways around this:
1. Factor out the untraceable logic into a top-level function and
use ``fx.wrap`` on it.
2. If the control flow is static (i.e. the loop trip count is
based on some hyperparameter), the code can be kept in its original
position and refactored into something like::

    for i in range(self.some_hyperparameter):
        indexed_item = proxied_value[i]

For a more detailed description into the Proxy internals, check out
the "Proxy" section in `torch/fx/README.md`
Tr"   Nr|   tracerOptional[TracerBase]c                 L    Uc  [        UR                  5      nX l        Xl        g r)   )r   rZ   r   r|   )r,   r|   r   s      r.   r+   Proxy.__init__  s    >)$**5F	r0   rh   c                 6    SU R                   R                   S3$ )NzProxy()r|   rf   rD   s    r.   __repr__Proxy.__repr__  s    		'q))r0   c                     [        X5      $ r)   r   )r,   ks     r.   __getattr__Proxy.__getattr__  s     !!r0   c                     U R                   $ r)   __dict__rD   s    r.   __getstate__Proxy.__getstate__  s    }}r0   c                    SS K n0 nU R                  R                  5        H  u  pE UR                  " XQ5      nXcU'   M     SU;   d   eSU;   d   e[        US   US   5      nUR                  5        H  u  pEXWR                  U'   M     U$ ! [         a@    [
        R                  SUU R                  R                  5        UR                   " U5      n Nf = f)Nr   zVShallow copy %s of Proxy because it cannot be deepcopied. Proxy is created for node %sr|   r   )
r?   r   itemsdeepcopy	Exceptionrz   warningr|   rf   r   )r,   memor?   new_dictr   vnew_obj	new_proxys           r.   __deepcopy__Proxy.__deepcopy__  s     	MM'')DA	'--0 "QK * !!!8###(6*HX,>?	NN$DA$%q! %  '3IINN	 ))A,'s   BACCc                     Xl         g r)   r   )r,   ds     r.   __setstate__Proxy.__setstate__  s    r0   c                 F    U R                   R                  SSU 4U-   U5      $ )Ncall_method__call__)r   r   r,   rH   re   s      r.   r   Proxy.__call__  s(    {{'':w~v
 	
r0   c                   ^  [         R                  " 5       nUc   eUR                  nUc   e[        [        R
                  " UR                  5      5      n[        R                  S:  a  SSK	J
n  U" X2R                  S S9nOUR                  S-  nX5   nUR                  S:X  a  U 4S j[        UR                  5       5       $ T R                  R!                  T 5      $ )	N      r   bisect_leftc                     U R                   $ r)   offsetr   s    r.   <lambda> Proxy.__iter__.<locals>.<lambda>   s    r0   key   UNPACK_SEQUENCEc              3   .   >#    U  H
  nTU   v   M     g 7fr)   r   )r   ir,   s     r.   r   !Proxy.__iter__.<locals>.<genexpr>  s     8%7DG%7s   )r   r   r   r   disget_instructionsr   sysversion_infobisectr  f_lastiopnamer   argvalr   r   )r,   r   calling_frame	inst_listr  inst_idxinsts   `      r.   __iter__Proxy.__iter__  s    $$&   (((--m.B.BCD	w&*"006HH %,,1H";;++8U4;;%788{{%%r0   c                 \    U R                   R                  S[        R                  U 40 5      $ Nrj   )r   r   operatorabsrD   s    r.   __abs__Proxy.__abs__
  s$    {{''wPRSSr0   c                    U R                   R                  (       GaD  [        R                  " 5       nUc   eUR                  nUc   e[        [        R                  " UR                  5      5      n[        R                  S:  a  SSKJn  U" X2R                  S S9nOUR                  S-  nX5   nUR                  S:X  a  X5S-      nUR                  c   eX6R                  S-  S-
     nUR                  S	:H  =(       a    UR                   S
:H  =(       d    UR                  S:H  n	U	(       a4  UR                  S:X  a$  U R                   R#                  S[$        U 40 5        gU R                   R'                  U 5      $ )Nr   r   r  c                     U R                   $ r)   r  r   s    r.   r   Proxy.__bool__.<locals>.<lambda>  s    ahhr0   r  r
  POP_JUMP_IF_TRUEr   LOAD_GLOBALAssertionErrorLOAD_ASSERTION_ERRORRAISE_VARARGSrj   T)r   r]   r   r   r   r   r  r  r   r  r  r  r  r  r  argr  r   r   r   )
r,   r   r  instsr  curr  firstlaststarts_with_asserts
             r.   __bool__Proxy.__bool__  sN   ;;$$$ ((*E$$$!LLM ,,,--m.B.BCDE7*.!%)>)>DVW#++q0:D{{00Agxx+++XX]Q./LLM1 9(88>||'== #
 &$++*HKK,,_i$RTU{{""4((r0   c                 8    U R                   R                  U 5      $ r)   )r   r   rD   s    r.   r   
Proxy.keys-  s    {{%%r0   c                     [        S5      e)Nz'len' is not supported in symbolic tracing by default. If you want this call to be recorded, please call torch.fx.wrap('len') at module scopeRuntimeErrorrD   s    r.   __len__Proxy.__len__1  s    
 	
r0   c           	      $  ^ ^ U(       a  UOSnU(       a  UO0 n0 mU U4S jn[        X55        [        XE5        [        T5      S:  a(  [        S[        TR	                  5       5       SU 35      e[        [        TR	                  5       5      5      n[        U[        R                  R                  5      (       a-  UR                  4U-   nUR                  SUR                  X45      $ [        R                  R                  U5      (       a  UR                  SUR                   X45      $ [        U[        R"                  R$                  5      (       a  [        S5      eUR                  SUUUUR&                  R)                  UR                   5      S	9$ )
Nr   c                 H   > [        U T5      (       a  S TU R                  '   g g r)   )r   r   )r   clstracerss    r.   find_tracer-Proxy.__torch_function__.<locals>.find_tracer?  s#    !S!!$(! "r0   r   z!Found multiple different tracers z" while trying to trace operations r   z1Unable to symbolically trace HigherOrderOperatorsrj   rf   )map_aggregatelenr7  r   r   nextr   r   rw   _CScriptMethodownerr   rf   	overridesis_tensor_method_or_propertyr1   r   r   rZ   _target_to_str)r<  orig_methodtypesrH   re   r>  r   r=  s   `      @r.   __torch_function__Proxy.__torch_function__8  s_   t!r#%	) 	d(f*w<!3D4H3I J..9]<  d7<<>*+k588#8#899%%'$.D&&}k6F6FUU??77DD&&{33T  +uzz'E'EFF"#VWW&&\\001E1EF '  r0   )r   r|   r   r)   )rh   r   )rh   r   r   )r1   r2   r3   r4   r5   r   r   r+   r6   r   r   r   r   r   r   r   r   r  r!  r   r1  r   r8  classmethodrL  r7   r   r0   r.   r   r     s    8 $/T +A  0*# *"
d D 4

&(7+ &(T)$ )@ $/& 0&
 % %r0   r   c                   f   ^  \ rS rSrSr SS\SS4U 4S jjjrS\4S jr\	SU 4S	 jj5       r
S
rU =r$ )r   ia  zO
A Proxy subclass that propagates metadata (meta['val']) during graph tracing.
r|   r   r   c                 0   > [         TU ]  X5        X0l        g r)   )r*   r+   	fake_mode)r,   r|   r   rQ  r-   s       r.   r+   MetaProxy.__init__g  s     	&"r0   rh   c                 6    SU R                   R                   S3$ )Nz
MetaProxy(r   r   rD   s    r.   r   MetaProxy.__repr__m  s    DIINN+1--r0   c           
        > U(       a  UOSnU(       a  UO0 nS nU H  n[        U[        5      (       d  M  Un  O   Uc   S5       e[        T	U ]  XX45      nUR                     U" U Vs/ s H3  n[        U[
        5      (       a  UR                  R                  S   OUPM5     sn0 UD6UR                  R                  S'   S S S 5        [        UR                  UR                  UR                  5      $ s  snf ! , (       d  f       N>= f)Nr   z5No MetaProxy found in arguments, but one is expected.val)	r   r   r*   rL  rQ  r   r|   rv   r   )
r<  rJ  rK  rH   re   
meta_proxyr+  r   r   r-   s
            r.   rL  MetaProxy.__torch_function__p  s    t!r
C#y)) 
  "	CB	C" *;tL!!%0MQRT
1e(<(<!&&++e$!CTR&&EJJOOE" "
 U\\:3G3GHH S "!s   "C9):C4
#C94C99
D)rQ  r   )r1   r2   r3   r4   r5   r   r+   r6   r   rN  rL  r7   r8   r9   s   @r.   r   r   a  sK    
 LP##"8# #.# . I Ir0   r   c                   N    \ rS rSr\" SS9S\S\4S j5       r\S 5       r	S r
S	rg
)r   i  Tr"   rootattrc                 L    Xl         X l        UR                  U l        S U l        g r)   )rZ  r[  r   _node)r,   rZ  r[  s      r.   r+   Attribute.__init__  s    		kk%)
r0   c                     U R                   cG  U R                  R                  S[        U R                  U R
                  40 5      R                  U l         U R                   $ r  )r]  r   r   r   rZ  r[  r|   rD   s    r.   r|   Attribute.node  sN     ::11499dii*@"d J zzr0   c                 n    U R                   R                  SU R                  U R                  4U-   U5      $ )Nr   )r   r   r[  rZ  r   s      r.   r   Attribute.__call__  s1    {{''499tyylT&96
 	
r0   )r]  r[  rZ  r   N)r1   r2   r3   r4   r   r   r6   r+   propertyr|   r   r7   r   r0   r.   r   r     s@    $/*U *# * 0*  
r0   r   c                   ~   ^  \ rS rSrSrS\S\4U 4S jjrS\4S jr	\
S 5       rS	 rS
 r\
S 5       rS rS rSrU =r$ )r   i  z
A special proxy which lets "shape", "size", "dim", and a few other
attribute accesses pass through to the underlying  module parameter object,
so that conditional tests on these attributes will not throw exception during tracing
r   r|   c                    > [         TU ]  X!5        [        U[        R                  R
                  5      (       d   eX@l        X0l        g r)   )r*   r+   r   rw   nn	Parameterparamrf   )r,   r   r|   rf   rh  r-   s        r.   r+   ParameterProxy.__init__  s7    &%!3!34444
	r0   rh   c                 "    SU R                    S3$ )NzParameterProxy(r   r@  rD   s    r.   r   ParameterProxy.__repr__  s     1--r0   c                 .    U R                   R                  $ r)   )rh  shaperD   s    r.   rm  ParameterProxy.shape  s    zzr0   c                 6    U R                   R                  5       $ r)   )rh  sizerD   s    r.   rp  ParameterProxy.size  s    zz  r0   c                 6    U R                   R                  5       $ r)   )rh  dimrD   s    r.   rs  ParameterProxy.dim  s    zz~~r0   c                 .    U R                   R                  $ r)   )rh  ndimrD   s    r.   rv  ParameterProxy.ndim  s    zzr0   c                 6    U R                   R                  5       $ r)   )rh  numelrD   s    r.   ry  ParameterProxy.numel  s    zz!!r0   c                 6    U R                   R                  5       $ r)   )rh  nelementrD   s    r.   r|  ParameterProxy.nelement  s    zz""$$r0   )rf   rh  )r1   r2   r3   r4   r5   r   r   r+   r6   r   rc  rm  rp  rs  rv  ry  r|  r7   r8   r9   s   @r.   r   r     sh    z  .# .    !   "% %r0   r   c                 j   ^  U 4S jnT Ul         ST R                  S5       S3n[        [        X!5        g )Nc                  h   > U S   R                   n[        [        T5      nUR                  SX0U5      $ )Nr   rj   )r   r   r  r   )rH   re   r   rd   methods       r.   impl_scope.<locals>.impl  s1    !W^^FXv.F&&fMMr0   ___)r1   stripsetattrr   )r  r  as_magics   `  r.   rA   rA     s4    	N
 S)*"-x&r0   c                 t   ^  ST R                  S5       S3nU 4S jnXl        Xl        [        [        X5        g )N__rr  r  c                 b   > [        [        T5      nU R                  R                  SX!U 40 5      $ r  )r   r  r   r   )r,   rhsrd   orig_method_names      r.   r  !_define_reflectable.<locals>.impl  s-    #34{{''tbQQr0   )r  r1   r3   r  r   )r  method_namer  s   `  r.   _define_reflectabler    s;    (..s34B7KR  M#E;%r0   c                     [        SU  35      e)NzJKeys for dictionaries used as an argument cannot contain a Node. Got key: r6  )r+  s    r.   _no_nodes_errorr    s    
		  r0   c                     0 nUR                  5        HN  u  p4[        U[        5      (       d!  U R                  U5      n[	        U[
        5        U R                  U5      X#'   MP     U$ r)   )r   r   r6   r   map_argr  )r,   r   rr   r   s        r.   r   r     sW    
A	!S!! "AA'q!  Hr0   .c                     U$ r)   r   r,   r   s     r.   r  r    s    qr0   c                     UR                   $ r)   )r|   r  s     r.   r  r    s    AFFr0   c                 `    [        U Vs/ s H  o R                  U5      PM     sn5      $ s  snf r)   )r   r   r,   r   r   s      r.   r  r    s%    EUV2WUVT??43HUV2W,X2Ws   +c                 N    U Vs/ s H  o R                  U5      PM     sn$ s  snf r)   )r   r  s      r.   r  r    s    a+PadOOD,Aa+P+Ps   ")Lr   r?   r  r   r   loggingr  r  r   collections.abcr   dataclassesr   r   typingr   r   r	   rw   torch.fx.tracebackfx	tracebackrq   torch._Cr
   rA  r   r  torch.utils._tracebackr   _compatibilityr   rZ   r   r   r   immutable_collectionsr   r   r|   r   r   r   r   operator_schemasr   __all__	getLoggerr1   rz   r    r!   ru   r   r   r   
ValueErrorr   r   r   r   r   r  rA   r  r  r  r   r   r   r   r   r   r   r   r   )ts   0r.   <module>r     s     
     
 # $ , * *  ) ) O 4 ) B B A 4 4 9
 ! e,' ' -'> e,  -: " d+N( N( ,N(d d+%: % ,% e, - d+	 	 ,	 d+{ { ,{| e,#I #I -#IL d+
 
 ,
0 e,"%U "% -"%J F' 6N 	& 2() 2
	T
 	S	 	

	
 	

&&	 	  3 5 X 5 P 4 + 4 %7%= > "%7%= > "	s   
H