
    Th                        S r SSKJr  SSKrSSKJr  \(       a  SSKrSSKrSSKr	\R                  " SSS9 " S S5      5       r\R                  " SSS9 " S	 S
5      5       rg)z8Module for handling ATen to ONNX functions registration.    )annotationsN)TYPE_CHECKINGT)frozeneqc                  J    \ rS rSr% SrS\S'   S\S'   SrS\S	'   SrS\S
'   Srg)ONNXFunction   aK  A wrapper of onnx-script function.

op_full_name: The qualified name of the function. In the form of '<namespace>::<op_name>.<overload>'.
onnx_function: The onnx-script function from torchlib.
is_custom: Whether the function is a custom function.
is_complex: Whether the function is a function that handles complex valued inputs.

z7onnxscript.OnnxFunction | onnxscript.TracedOnnxFunctiononnx_functionstrop_full_nameFbool	is_custom
is_complex N)	__name__
__module____qualname____firstlineno____doc____annotations__r   r   __static_attributes__r       ^/var/www/fran/franai/venv/lib/python3.13/site-packages/torch/onnx/_internal/fx/registration.pyr   r      s*     KJItJr   r   c                      \ rS rSr% SrS\S'   S\S'   S\S'   \ S       SS jj5       r\SS	 j5       r\SS
 j5       r	\    SS j5       r
SS jrSrg)OpName%   zAA class representing an operator name in internal ONNX converter.r   	namespaceop_nameoverloadNc                *    Ub  US:X  a  SnU " XU5      $ )N defaultr   )clsr   r   r   s       r   from_name_partsOpName.from_name_parts-   s"     x2~ H9x00r   c                |    UR                  S5      u  p#UR                  SS5      tpEU(       a  US   OSnU " X$U5      $ )z4When the name is <namespace>::<op_name>[.<overload>]::.   r   r"   )split)r#   qualified_namer   opname_overloadr   r   s         r   from_qualified_nameOpName.from_qualified_name7   sF     &4%9%9$%?"	,223:"*8A;	9x00r   c                @    U R                  UR                  5       5      $ N)r-   name)r#   op_overloads     r   from_op_overloadOpName.from_op_overload?   s    &&{'7'7'9::r   c                `    UR                   nUR                  nU R                  US-   U-   5      $ )aH  From a builtin function, e.g. operator.add, math.ceil, etc, get the OpName.

FX graph uses built-in functions to caculate sympy expression. This function
is used to get the OpName from a builtin function.

Args:
    builtin_function (types.BuiltinFunctionType): operator.add, math.ceil, etc.

Returns:
    OpName: _description_
r'   )r   r   r-   )r#   builtin_functionopmodules       r   from_builtin_functionOpName.from_builtin_functionC   s4     &&!,,&&v}r'9::r   c                R    U R                    SU R                   SU R                   3$ )Nr'   r(   )r   r   r   )selfs    r   r+   OpName.qualified_nameV   s&    ..!DLL>4==/BBr   r   r0   )r   r   r   r   r   z
str | Nonereturnr   )r+   r   r>   r   )r2   ztorch._ops.OpOverloadr>   r   )r6   ztypes.BuiltinFunctionTyper>   r   )r>   r   )r   r   r   r   r   r   classmethodr$   r-   r3   r9   r+   r   r   r   r   r   r   %   s    KNLMBF11&)15?1	1 1 1 1 ; ; ;8;	; ;$Cr   r   )r   
__future__r   dataclassestypingr   types
onnxscript
torch._opstorch	dataclassr   r   r   r   r   <module>rH      sn    > "     dt,  -  dt,1C 1C -1Cr   