
    [Th                        % S SK r S SKrS SKrS SKrS SKrS SKJrJr  S SKJ	r	J
r
JrJrJrJ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  \(       a  SS
KJr  / SQr\R>                  " \ 5      r!\\"\#\$\%\&\RN                  \RP                  \RR                  \RT                  \RV                  \R0                  RX                  \RZ                  \R\                  \R^                  4   r0\0Rb                  r2\\
S\	4   \"4   r3\\\4S   \S   \\"S4   \5\6S\04      r7\" S\7S9r8\9Ru                  / SQ5      r;\Rx                  Rz                  \R|                  R~                  \R|                  R                  /rA\B\
   \CS'   \R                  \R                  \R                  R                  R                  \R                  R                  R                  \R                  R                  R                  \R                  R                  R                  \R                  R                  R                  \R                  R                  \R                  R                  \R                  R                  \R                  R                  R                  \R                  1\T" \A5      -  rU\T\
   \CS'   \V" \R                  S5      (       a/  \UR                  \R                  R                  R                  5        \" SS9S\
S\
4S j5       rYS\
S\	4   S\"4S jrZS\[S\"4S jr\S\
S\	4   S\"4S  jr]\$" S!5      4S"\[S#\$S\"4S$ jjr^\" S%S9 " S& S\5      5       r_\" S%S9S'\8S\
\_/\74   S\84S( j5       r`\" S%S9S'\8S\
\7/\74   S\84S) j5       rag)*    N)MappingSequence)AnyCallableOptionalTYPE_CHECKINGTypeVarUnion)_fx_map_aggregate_fx_map_arg	_NodeBase)ArgsKwargsPairnormalize_functionnormalize_module   )ops   )compatibility)Graph)Nodemap_argmap_aggregatehas_side_effect.Argument.r   r   	ArgumentT)bound)placeholdercall_methodcall_modulecall_functionget_attroutputroot1_side_effectful_need_to_be_preserved_pre_dispatch_side_effectful_functionsresize_storage_bytes_Fis_backward_compatiblefnreturnc                 0    [         R                  U 5        U $ N)r&   add)r*   s    E/var/www/auris/envauris/lib/python3.13/site-packages/torch/fx/node.pyr   r   h   s    !!"%I    orig_methodc                     U R                   nU R                  nUb  U$ [        [        R                  R                  4 H   n[        X1S 5      U L d  M  UR                   s  $    [        SU  35      e)Nzcannot find module for )__name__
__module__torchnn
functionalgetattrRuntimeError)r1   namemoduleguesss       r/   _find_module_of_methodr=   o   sj    D##F,,-5%4>>! . 0>
??r0   objc                 P   [        U [        5      (       aV  [        U [        R                  5      (       d7  U R                  S:X  a  U R
                  $ U R                   SU R
                   3$ U SL a  g[        U [        R                  5      (       a  U R                  $ [        U 5      $ )a&  Return the repr() of an object, special-casing types (internal helper).
If obj is a type, we return a shorter version than the default
type.__repr__, based on the module and qualified name, which is
typically enough to uniquely identify a type.  For everything
else, we fall back on repr(obj).
builtins..z...)	
isinstancetypetypesGenericAliasr4   __qualname__FunctionTyper3   repr)r>   s    r/   
_type_reprrI   |   s     #tZU5G5G%H%H>>Z'###..!3#3#3"455
cz#u))**||9r0   funcc                 Z   [        [        U R                  S 5      U L a  U R                  $ [        U [        R
                  [        R                  45      (       a7  U [        [        R                  U R                  S 5      L a  SU R                   3$ U R                  nUS:X  a7   [        R                  " U 5      R                  S5      S   R                  5       n[        U 5      nUR!                  SS5      nUS:X  a  US	:X  a  S
U-   nU SU 3$ ! [         a  n[        S5      UeS nAff = f)Nztorch.Tensor.z<lambda>=r   zUnable to represent lambdaz
torch._opsz	torch.opsr5   segment_reduce_rA   )r8   r@   r3   rB   rD   MethodDescriptorTypeWrapperDescriptorTyper5   Tensorinspect	getsourcesplitstrip	Exceptionr9   r=   replace)rJ   r:   er;   s       r/   _get_qualified_namerY      s   x-5}}u))5+F+FG 
'%,,t<
<t}}o..==Dz	D$$T*005a8>>@D $D)F^^kF T%55TzXQtf  	D;<!C	Ds   $6D 
D*D%%D*infargmax_list_lenc                   ^ [        U S5      (       a  U R                  5       $ [        U [        5      (       aO  SR	                  U4S j[        U 5       5       5      n[        U 5      TS-   :  a  SOS[        U 5       S3nSU U S3$ [        U [        5      (       ad  SR	                  U4S	 j[        U 5       5       5      n[        U 5      TS-   :  a  SOS[        U 5       S3n[        U 5      S:X  a  S
OSnSU U U S3$ [        U [        5      (       a,  SR	                  S U R                  5        5       5      nSU S3$ [        U [        5      (       a  S[        U 5      -   $ [        U 5      $ )N_custom_fx_repr_fnz, c              3   N   >#    U  H  u  pUT:  d  M  [        U5      v   M     g 7fr-   _format_arg.0idxar\   s      r/   	<genexpr>_format_arg.<locals>.<genexpr>   %      
)7vs3;MNKNN   %%r    z, ...[total_len=][c              3   N   >#    U  H  u  pUT:  d  M  [        U5      v   M     g 7fr-   r`   rb   s      r/   rf   rg      rh   ri   ,()c              3   F   #    U  H  u  pU S [        U5       3v   M     g7f): Nr`   )rc   kvs      r/   rf   rg      s"     O;412k!n%56;s   !{}%)hasattrr^   rB   listjoin	enumeratelentupledictitemsr   str)r[   r\   r   	maybe_lenmaybe_comma	items_strs    `    r/   ra   ra      se   s())%%''	C				 
)23
 
 c(\A--B5Ec#hZq3Q 	 5')A&&	C				 
)23
 
 c(\A--B5Ec#hZq3Q 	 !X]c5'+yk33	C		IIO399;OO	I;b!!#tSX~3xr0   Tc                   l  ^  \ rS rSr% Sr\S   \S'   \\S4   \S'   S\S'   \\S	'   \\S
'   S\S'   \S   \S'   \S   \S'   \	\
   \S'   \
\S'   \	\S /\4      \S'   \\\
4   \S'   \" SS9 SRSSS	\S
\SSS\S   S\\S4   S\	\
   SS4U 4S jjj5       rS\\\
4   4S jrS\\\
4   SS4S jr\SSS j5       r\SSS  j5       r\" SS9STS! j5       rS"S S\4S# jrS"S S\4S$ jrS"S S\4S% jrS"S S\4S& jr\" SS9STS' j5       rSUS( jr\S\\S)4   4S* j5       r\R:                  S+\\S)4   SS4S, j5       r\S\\\4   4S- j5       r\R:                  S.\\\4   SS4S/ j5       r\S\S    4S0 j5       r \" SS9S1\!S2\SS4S3 j5       r"\" SS9S1\!S2\SS4S4 j5       r#\" SS9S5\S2\SS4S6 j5       r$\S\	\   4S7 j5       r%\%R:                  S8\	\   SS4S9 j5       r%S\4S: jr&\'S\(S\4S; j5       r)\" SS9  SVS<\	\\      S=\	\\      S\	\   4S> jj5       r*\" SS9S? 4S@SA.SBS SC\S /\4   SD\S\S    4SE jjj5       r+\" S@S9S\4SF j5       r,\" S@S9   SWSG\-R\                  R^                  SH\	\\
      SI\	\\\
4      SJ\S\	\0   4
SK jj5       r1\" SS9SXSL j5       r2SM\SS4SN jr3S	\SO\
SS4SP jr4SQr5U =r6$ )Yr      a  
``Node`` is the data structure that represents individual operations within
a ``Graph``. For the most part, Nodes represent callsites to various entities,
such as operators, methods, and Modules (some exceptions include nodes that
specify function inputs and outputs). Each ``Node`` has a function specified
by its ``op`` property. The ``Node`` semantics for each value of ``op`` are as follows:

- ``placeholder`` represents a function input. The ``name`` attribute specifies the name this value will take on.
  ``target`` is similarly the name of the argument. ``args`` holds either: 1) nothing, or 2) a single argument
  denoting the default parameter of the function input. ``kwargs`` is don't-care. Placeholders correspond to
  the function parameters (e.g. ``x``) in the graph printout.
- ``get_attr`` retrieves a parameter from the module hierarchy. ``name`` is similarly the name the result of the
  fetch is assigned to. ``target`` is the fully-qualified name of the parameter's position in the module hierarchy.
  ``args`` and ``kwargs`` are don't-care
- ``call_function`` applies a free function to some values. ``name`` is similarly the name of the value to assign
  to. ``target`` is the function to be applied. ``args`` and ``kwargs`` represent the arguments to the function,
  following the Python calling convention
- ``call_module`` applies a module in the module hierarchy's ``forward()`` method to given arguments. ``name`` is
  as previous. ``target`` is the fully-qualified name of the module in the module hierarchy to call.
  ``args`` and ``kwargs`` represent the arguments to invoke the module on, *excluding the self argument*.
- ``call_method`` calls a method on a value. ``name`` is as similar. ``target`` is the string name of the method
  to apply to the ``self`` argument. ``args`` and ``kwargs`` represent the arguments to invoke the module on,
  *including the self argument*
- ``output`` contains the output of the traced function in its ``args[0]`` attribute. This corresponds to the "return" statement
  in the Graph printout.
r   _argsr   _kwargsr   graphr:   opTargettarget)r   N_input_nodesusersrC   	_sort_key_repr_fnmetaTr(   Nargskwargsreturn_typer+   c                 j  > US:X  a=  [        U5      (       d,  [        SU SU SU S[        R                  " U5       S3	5      eOMU[        ;   d   e[        U[        5      (       d,  [        SU SU SU S[        R                  " U5       S3	5      e[        TU ]!  XX4U5        U R                  XV5        g)	a  
Instantiate an instance of ``Node``. Note: most often, you want to use the
Graph APIs, i.e. ``Graph.call_module``, ``Graph.call_method``, etc. rather
than instantiating a ``Node`` directly.

Args:
    graph (Graph): The ``Graph`` to which this ``Node`` should belong.

    name (str): The name to which the output of this ``Node`` should be assigned

    op (str): The opcode for this ``Node``. Can be one of 'placeholder',
        'call_method', 'call_module', 'call_function', 'get_attr',
        'output'

    target ('Target'): The target this op should call. See the broader
        ``Node`` docstring for more details.

    args (Tuple['Argument']): The args to be passed to ``target``

    kwargs (Dict[str, 'Argument']): The kwargs to be passed to ``target``

    return_type (Optional[Any]): The python type expression representing the
        type of the output of this node. This field can be used for
        annotation of values in the generated code or for other types
        of analyses.
r!   zNode [graph = z
, name = 'z
'] target z
 has type z but a Callable is expectedz but a str is expectedN)
callable
ValueErrorr5   typename
_legal_opsrB   r   super__init___update_args_kwargs)	selfr   r:   r   r   r   r   r   	__class__s	           r/   r   Node.__init__
  s    J  F## $UG:dV:fXZX]XfXfgmXnWo p1 1  $ ###fc** $UG:dV:fXZX]XfXfgmXnWo p, ,  	b+>  .r0   c                 n   0 U R                   EU R                  U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  S.E$ )N)r   r:   r   r   rC   r   r   r   _erased_prev_nextr   r   r   r   )__dict__r   r:   r   r   r   r   r   r   r   r   r   r   r   r   r   s    r/   __getstate__Node.__getstate__?  s    
mm
ZZII''kkKKZZ||||ZZZZ --ZZII!
 	
r0   statec                 N    UR                  5        H  u  p#[        XU5        M     g r-   )r   setattr)r   r   rs   rt   s       r/   __setstate__Node.__setstate__S  s    KKMDADQ "r0   c                     U R                   $ )zv
Returns the next ``Node`` in the linked list of Nodes.

Returns:

    The next ``Node`` in the linked list of Nodes.
)r   r   s    r/   next	Node.nextW       zzr0   c                     U R                   $ )z~
Returns the previous ``Node`` in the linked list of Nodes.

Returns:

    The previous ``Node`` in the linked list of Nodes.
)r   r   s    r/   prev	Node.prevb  r   r0   c                 H   U R                   UR                   :X  d   S5       eX:X  a  [        R                  S5        gUR                  5         U R                  nXsUl        Ul        XsUl        U l        UR                  R                  nUR
                  R                  n[        U5      [        U5      :  a#  US[        U5      S-    Gt pV/ UQUS-   P7Ul        g[        U5      [        U5      :  a#  US[        U5      S-    Gt pV/ UQUS-
  P7Ul        g/ UQSP7Ul        g)a  
Insert x before this node in the list of nodes in the graph. Example::

    Before: p -> self
            bx -> x -> ax
    After:  p -> x -> self
            bx -> ax

Args:
    x (Node): The node to put before this node. Must be a member of the same graph.
z0Attempting to move a Node into a different GraphzMTrying to prepend a node to itself. This behavior has no effect on the graph.Nr   r   )r   logdebug_remove_from_listr   r   r   r|   )r   xppsknskprefixrd   s          r/   prependNode.prependm  s    zzQWW$X&XX$9II_ 	JJ" ggggs8c#h~SA.LV,F,C!G,AKXC ~SA.LV,F,C!G,AK#C))AKr0   otherc                 4    U R                   UR                   :  $ r-   r   r   r   s     r/   __gt__Node.__gt__      ~~//r0   c                 4    U R                   UR                   :  $ r-   r   r   s     r/   __lt__Node.__lt__  r   r0   c                      X:  =(       d    X:H  $ r-    r   s     r/   __ge__Node.__ge__      |,t},r0   c                      X:  =(       d    X:H  $ r-   r   r   s     r/   __le__Node.__le__  r   r0   c                 :    U R                   R                  U5        g)z
Insert ``x`` after this node in the list of nodes in the graph.
Equivalent to ``self.next.prepend(x)``

Args:
    x (Node): The node to put after this node. Must be a member of the same graph.
N)r   r   )r   r   s     r/   appendNode.append  s     	

1r0   c                 N    U R                   U R                  p!X!sUl        Ul         g r-   )r   r   )r   r   ns      r/   r   Node._remove_from_list  s    zz4::1r0   .c                     U R                   $ )a  
The tuple of arguments to this ``Node``. The interpretation of arguments
depends on the node's opcode. See the :class:`Node` docstring for more
information.

Assignment to this property is allowed. All accounting of uses and users
is updated automatically on assignment.
)r   r   s    r/   r   	Node.args  s     zzr0   re   c                 :    U R                  XR                  5        g)z
Set the tuple of arguments to this Node. The interpretation of arguments
depends on the node's opcode. See the ``fx.Graph`` docstring for more
information.
N)r   r   )r   re   s     r/   r   r     s     	  LL1r0   c                     U R                   $ )a  
The dict of keyword arguments to this ``Node``. The interpretation of arguments
depends on the node's opcode. See the :class:`Node` docstring for more
information.

Assignment to this property is allowed. All accounting of uses and users
is updated automatically on assignment.
)r   r   s    r/   r   Node.kwargs  s     ||r0   rs   c                 <    U R                  U R                  U5        g)z
Set the dict of kwargs to this Node. The interpretation of arguments
depends on the node's opcode. See the ``fx.Graph`` docstring for more
information.
N)r   r   )r   rs   s     r/   r   r     s     	  Q/r0   c                 H    [        U R                  R                  5       5      $ )a  
Return all Nodes that are inputs to this Node. This is equivalent to
iterating over ``args`` and ``kwargs`` and only collecting the values that
are Nodes.

Returns:

    List of ``Nodes`` that appear in the ``args`` and ``kwargs`` of this
    ``Node``, in that order.
)ry   r   keysr   s    r/   all_input_nodesNode.all_input_nodes  s     D%%**,--r0   rd   r[   c                 V    [        U R                  5      nX#U'   [        U5      U l        g)a  
Update an existing positional argument to contain the new value
``arg``. After calling, ``self.args[idx] == arg``.

Args:

    idx (int): The index into ``self.args`` of the element to update
    arg (Argument): The new argument value to write into ``args``
N)ry   r   r}   )r   rd   r[   r   s       r/   
update_argNode.update_arg  s#     DIIS	$K	r0   c                    SUs=::  a   [        U R                  5      ::  d    S5       e   S5       eU R                  SU nU R                  US nX24-   U-   U l        0 n[        X%R                  5        UR                  5        HJ  nX`R                  ;  d  M  U R                  R	                  U5        UR                  R	                  U 5        ML     g)z
Insert an positional argument to the argument list with given index.

Args:

    idx (int): The index of the element in ``self.args`` to be inserted before.
    arg (Argument): The new argument value to insert into ``args``
r   z6insert_args index must be between 0 and len(self.args)N)r|   r   r   r   
setdefaultr   r   r   )r   rd   r[   	args_left
args_right_new_input_nodesnew_uses          r/   
insert_argNode.insert_arg  s     &DII&	DC	D&	DC	D&IIdsO	YYst_
'*4
-/C445',,.G///!!,,W5((. /r0   keyc                 0    0 U R                   EX0EU l         g)a  
Update an existing keyword argument to contain the new value
``arg``. After calling, ``self.kwargs[key] == arg``.

Args:

    key (str): The key in ``self.kwargs`` of the element to update
    arg (Argument): The new argument value to write into ``kwargs``
N)r   )r   r   r[   s      r/   update_kwargNode.update_kwarg  s     0/c/r0   c                 :    U R                   R                  SS5      $ )a  
Return the Python stack trace that was recorded during tracing, if any.
When traced with fx.Tracer, this property is usually populated by
`Tracer.create_proxy`. To record stack traces during tracing for debug purposes,
set `record_stack_traces = True` on the `Tracer` instance.
When traced with dynamo, this property will be populated by default by
`OutputGraph.create_proxy`.

stack_trace would have the innermost frame at the end of the string.
stack_traceN)r   getr   s    r/   r   Node.stack_trace  s     yy}}]D11r0   tracec                      XR                   S'   g )Nr   )r   )r   r   s     r/   r   r   -  s    #(		- r0   c                 ^    U R                   (       a  U R                  U 5      $ U R                  $ r-   )r   r:   r   s    r/   __repr__Node.__repr__1  s"    ====&&yyr0   c                     [        U [        5      (       a  U $ [        U S5      (       aE  [        U SS5      nUc  [	        U 5      $ U R
                  S:X  a  SU 3$ U R
                  S:X  a  SU 3$ [	        U 5      $ )z
Make target printouts more user-friendly.
1) builtins will be printed as `builtins.xyz`
2) operators will be printed as `operator.xyz`
3) other callables will be printed with qualified name, e.g. torch.add
r4   r3   Nr@   z	builtins.	_operatorz	operator.)rB   r   rx   r8   rY   r4   )r   r:   s     r/   _pretty_print_targetNode._pretty_print_target6  s     fc""M6<((6:t4D| +622  J."4&))""k1"4&))"6**r0   placeholder_namesmaybe_return_typenamec                 X   U R                   S:X  Ga  [        U R                  [        5      (       d   eU R                  nX0R                  (       a  US[        U R                  5       3-   OS-  nU(       a  UR                  U5        gU R                  (       a  [        U R                  5       S3OSnU R                  (       a  S[        U R                  S   5      -   S-   OSnS	U R                   S
U S[        U R                  5       SU R                    SU R                   SU 3$ U R                   S:X  ay  U R                  b  [        U R                  5       S3OSnS	U R                   S
U S[        U R                  5       SU R                    SU R                  U R                  5       S3$ U R                   S:X  aE  U R                  (       a"  U(       a  S[        U R                  5       3US'   SU R                  S    3$ U R                  b  [        U R                  5       S3OSnS	U R                   S
U S[        U R                  5       SU R                    SU R                  U R                  5       S[        U R                  5       S[        U R                  5       S3$ )aO  
Return a descriptive string representation of ``self``.

This method can be used with no arguments as a debugging
utility.

This function is also used internally in the ``__str__`` method
of ``Graph``. Together, the strings in ``placeholder_names``
and ``maybe_return_typename`` make up the signature of the
autogenerated ``forward`` function in this Graph's surrounding
GraphModule. ``placeholder_names`` and ``maybe_return_typename``
should not be used otherwise.

Args:
    placeholder_names: A list that will store formatted strings
        representing the placeholders in the generated
        ``forward`` function. Internal use only.
    maybe_return_typename: A single-element list that will store
        a formatted string representing the output of the
        generated ``forward`` function. Internal use only.

Returns:
    str: If 1) we're using ``format_node`` as an internal helper
        in the ``__str__`` method of ``Graph``, and 2) ``self``
        is a placeholder Node, return ``None``. Otherwise,
        return a  descriptive string representation of the
        current Node.
r   rr   rj   N z	(default=r   rp   rw   z : z[num_users=z] = z[target=rk   r"   r#   z -> zreturn z	](args = z, kwargs = )r   rB   r   r   rC   rI   r   r   r:   r|   r   r   ra   r   )r   r   r   arg_strmaybe_typenamedefault_vals         r/   format_nodeNode.format_nodeO  sn   D 77m#dkk3////kkGw2j&;%<!==PRRG !((1<@II
499 56a82NCG99+DIIaL(99C?RTKtyyk^$4KDJJ?PPTUYU\U\T]]efjfqfqerrst  tA  B  BWW
"/3yy/D:dii()+"  DII;c.!1S_<MT77)8D$=$=dkk$J#K1N WW yy2-1*TYY2G1H+I%a(TYYq\N++ 04yy/D:dii()+"  DII;c.!1S_<MT77)8D$=$=dkk$J#K L%dii01[=U<VVWYr0   c                     g)NTr   )users    r/   <lambda>Node.<lambda>  s    r0   F)propagate_metareplace_withdelete_user_cbr	  c                ^  ^ ^ U(       aR  [        TR                  5      S:X  d   S5       eT R                  R                  5        H  u  pEUTR                  U'   M     [        T R                  5      n/ nT R
                  R                  nU H  n	U" U	5      (       d  UR                  U	5        M#  S[        S[        4UU 4S jjn
[        USS5      (       a%  UR                   H  nU" T TR                  U	S9  M     [        U	R                  U
5      n[        U	R                  U
5      n[        U[         5      (       d   e[        U["        5      (       d   eU	R%                  X5        M     [        T R                  5      [        U5      -
  S:X  d   eU Vs/ s H  oU;  d  M
  UPM     sn$ s  snf )	a_  
Replace all uses of ``self`` in the Graph with the Node ``replace_with``.

Args:

    replace_with (Node): The node to replace all uses of ``self`` with.
    delete_user_cb (Callable): Callback that is called to determine
      whether a given user of the self node should be removed.
    propagate_meta (bool): Whether or not to copy all properties
      on the .meta field of the original node onto the replacement node.
      For safety, this is only valid to do if the replacement node
      doesn't already have an existing .meta field.

Returns:

    The list of Nodes on which this change was made.
r   zmCalled node.replace_all_uses_with(replace_with, propagate_meta=True), but replace_with already has .meta keysr   r+   c                    > U T:X  a  T$ U $ r-   r   )r   r
  r   s    r/   maybe_replace_node6Node.replace_all_uses_with.<locals>.maybe_replace_node  s    9''Hr0   _replace_hooksNoldnewr  )r|   r   r   ry   r   r   owning_moduler   r   r8   r  r:   r   r   r   rB   r}   r~   r   )r   r
  r  r	  rs   rt   
to_processskippedmuse_noder  replace_hooknew_args
new_kwargsr   s   ``             r/   replace_all_uses_withNode.replace_all_uses_with  s~   2 |(()Q. :. 		)'(!!!$ *$**%
JJ$$"H!(++x(d t   q*D11$%$4$4L T|/@/@xP %5 #8==2DEH$X__6HIJh....j$////((>' #* 4::W-222%::a')9::::s   	F*!F*c                     U R                   S;   a  gU R                   S:X  a\  [        U R                  SS5      nUb  UR                  (       a  g[        U R                  SS5      (       a  gU R                  [        ;   $ U R                   S:X  aq  U R
                  R                  c   S	5       eU R
                  R                  R                  U R                  5      nUc   S
U R                   35       e[        USS5      $ g)z
Returns whether this op is impure, i.e. if its op is a placeholder or
output, or if a call_function or call_module which is impure.

Returns:

    bool: If the op is impure or not.
>   r#   r   Tr!   _schemaN_nondeterministic_seededFr    z1self.graph.owning_module not set for purity checkz'Did not find expected submodule target 
_is_impure)r   r8   r   
is_mutabler&   r   r  get_submodule)r   schema
target_mods      r/   	is_impureNode.is_impure  s     77//77o%T[[)T:F!f&7&7t{{$>FF;;";;; 77m#

((4CBC411??LJ&G8FG&:|U;;r0   r$   	arg_typeskwarg_typesnormalize_to_only_use_kwargsc                 n   U R                   S:X  aI  [        U R                  5      (       d   e[        U R                  U R                  U R
                  UU5      $ U R                   S:X  aL  [        U R                  [        5      (       d   e[        XR                  U R                  U R
                  5      $ g)a1  
Returns normalized arguments to Python targets. This means that
`args/kwargs` will be matched up to the module/functional's
signature and return exclusively kwargs in positional order
if `normalize_to_only_use_kwargs` is true.
Also populates default values. Does not support positional-only
parameters or varargs parameters.

Supports module calls.

May require `arg_types` and `kwarg_types` in order to disambiguate overloads.

Args:
    root (torch.nn.Module): Module upon which to resolve module targets.
    arg_types (Optional[Tuple[Any]]): Tuple of arg types for the args
    kwarg_types (Optional[Dict[str, Any]]): Dict of arg types for the kwargs
    normalize_to_only_use_kwargs (bool): Whether to normalize to only use kwargs.

Returns:

    Returns NamedTuple ArgsKwargsPair, or `None` if not successful.
r!   r    N)	r   r   r   r   r   r   rB   r   r   )r   r$   r(  r)  r*  s        r/   normalized_argumentsNode.normalized_arguments  s    < 77o%DKK((((%		  WW%dkk3////#D++tyy$++NNr0   c                   ^^ S[         S[         4UU4S jjnU R                  R                  n[        USS5      (       a%  UR                   H  nU" TTR
                  U S9  M     [        U R                  U5      n[        U R                  U5      n[        U[        5      (       d   e[        U[        5      (       d   eU R                  Xg5        g)z
Loop through input nodes of ``self``, and replace all instances of
``old_input`` with ``new_input``.

Args:

    old_input (Node): The old input node to be replaced.
    new_input (Node): The new input node to replace ``old_input``.
r   r+   c                    > U T:X  a  T$ U $ r-   r   )r   	new_input	old_inputs    r/   r  3Node.replace_input_with.<locals>.maybe_replace_node+  s     !Y95A5r0   r  Nr  )r   r   r  r8   r  r:   r   r   r   rB   r}   r~   r   )r   r1  r0  r  r  r  r  r  s    ``     r/   replace_input_withNode.replace_input_with  s    	6$ 	64 	6 	6 JJ$$1&-- ! 0 0	TJ !1 tyy*<= .@A
(E*****d++++  6r0   	candidatec                     XR                   :X  a  g U R                  R                  R                  US 5      nX l         U R                  R                  R	                  X5        g r-   )r:   r   _graph_namespacecreate_name_rename_object)r   r5  r:   s      r/   _renameNode._rename9  sH    		!zz**66y$G	

##224>r0   valuec                 j   US:X  a}  [        U S5      (       al  U R                  R                  n[        USS 5      (       aD  [	        U[
        5      (       d   eU R                   H  nUR                   H
  nU" XUS9  M     M     Sn[        X5      (       a[  [        U R                  S5      (       a@  X R                  R                  ;   a'  SnU R                  R                  R                  U 5        [        R                  XU5        U(       a&  U R                  R                  R                  U 5        g g )Nr:   r  r  F_find_nodes_lookup_tableT)rx   r   r  r8   rB   r   r   r  r>  removeobject__setattr__insert)r   r:   r<  r  r  r  updates          r/   rA  Node.__setattr__@  s    6>gdF33

((Aq*D11!%---- JJD()(8(8$tD )9 ' D

$>??

;;;FJJ//66t<4u-JJ//66t< r0   )r   r   r   r   r:   r-   )r+   r   )r   r   r+   N)r+   N)NN)NNF)r1  r   r0  r   r+   N)7r3   r4   rF   __firstlineno____doc__r}   __annotations__r~   r   r   r   r   r   r   r   r   propertyr   r   r   boolr   r   r   r   r   r   r   r   setterr   ry   r   intr   r   r   r   r   staticmethodr@  r   r  r  r&  r5   r6   Moduler   r,  r3  r:  rA  __static_attributes____classcell__)r   s   @r/   r   r      sC   6 !!#z/""N
IG  |$$
  3-Nx#.// sCx.$/ &*2/2/ 2/ 	2/
 2/ O$2/ S*_%2/ c]2/ 
2/ 02/h
d38n 
( $sCx.  T       $/"$ 0"$H0F 0t 00F 0t 0-F -t --F -t - $/ 0  	eHcM* 	 	 
[[2eHcM* 2t 2 2 	S(]+ 	 	 ]]0S(]+ 0 0 0 .f . . $/ c    T   0  $//c / /T / 0/2 $/
0 
0( 
0t 
0 0
0 2Xc] 2 2 )# )4 ) )# 
 +V + + +0 $/ 2659?#DI.?  (S	2? 
#	? 0?B $/ 4E8;
  %8;8; !&408;
 8; 
f8; 08;t %0#4 # 1#J %0 +/04-2*hhoo* E#J'* d38n-	*
 '+* 
.	!* 1*X $/7 072? ? ?= =C =D = =r0   re   c                 F    [        U5      (       d   S5       e[        X5      $ )z
Apply fn recursively to each Node appearing in arg.

arg may be a list, tuple, slice, or dict with string keys: the return value will
have the same type and structure.
z.torch.fx.map_arg(a, fn): fn must be a callable)r   r   re   r*   s     r/   r   r   U  s#     B<<III<qr0   c                     [        X5      $ )z
Apply fn recursively to each object appearing in arg.

arg may be a list, tuple, slice, or dict with string keys: the return value will
have the same type and structure.
)r   rQ  s     r/   r   r   a  s     Q##r0   )br@   rR   loggingoperatorrD   collections.abcr   r   typingr   r   r   r   r	   r
   r5   torch._Cr   r   r   torch.fx.operator_schemasr   r   r   _opsr   _compatibilityr   r   r   __all__	getLoggerr3   r   r   rK  floatrI  complexdtyperQ   devicememory_formatlayout
OpOverloadSymIntSymBoolSymFloatBaseArgumentTypes__args__
base_typesr   r}   sliceranger   r   r~   fromkeysr   _C_set_grad_enabledamp_enter_autocast_exit_autocastr%   ry   rG  _assert_assert_asyncatenmsg_assert_scalardefault_assert_tensor_metadatasym_constrain_rangesym_constrain_range_for_sizeprofiler_record_function_enter_record_function_enter_new_record_function_exitinductoraccumulate_grad_setitemsetr&   rx   r.   r'   r   r=   r@  rI   rY   ra   r   r   r   r   r0   r/   <module>r     s        - I I  > >   ) 
A!		KK	LL	LL		LL	JJ	LL	MM	NN   ''
	xS!3&	'	oZ 	
 Kx0	]]

  
HH	II	IIE 14>  
MM	IIII$$II%%--II!!))II**22MM((MM,,MM''MM""**, 9:,; 3x= ; 4==122!!$--"E"E"M"MN e, X  -@c(: @s @F s (hsCx0 S 4 49< V 5 C < d+I
=9 I
= ,I
=X d+y hvx'78 Y  , d+$Y $HhZ-A$B $y $ ,$r0   