
     Ti$8                    "   S r SSKJr  SSKrSSKJr  SSKrSSKr " S S\R                  5      r
 " S S\R                  5      r0 \R                  S	_\R                  S
_\R                  S
_\R                  S_\R                   S_\R"                  S	_\R$                  S_\R&                  S
_\R(                  S_\R*                  S_\R,                  S	_\R.                  S_\R0                  S_\R2                  S_\R4                  S_\R6                  S
_\R8                  S
_\R:                  S
\R<                  S
\R>                  S\R@                  S\RB                  S\RD                  S
\RF                  S\RH                  S0Er%0 \RL                  " S5      \R&                  _\RL                  " S5      \R2                  _\RL                  " S5      \R0                  _\RL                  " S5      \R(                  _\RL                  " S5      \R                  _\RL                  " S5      \R*                  _\RL                  " S5      \R                   _\RL                  " S5      \R"                  _\RL                  " S5      \R$                  _\RL                  " S5      \R                  _\RL                  " S5      \RN                  _\RL                  " S5      \R                  _\RL                  " S5      \R,                  _\RL                  " S5      \R.                  _\RL                  " S5      \R                  _\RL                  " \RP                  5      \R4                  _\RL                  " \RR                  5      \R6                  _\RL                  " \RT                  5      \R8                  \RL                  " \RV                  5      \R:                  \RL                  " \RX                  5      \R<                  \RL                  " \RZ                  5      \RD                  \RL                  " \R\                  5      \R@                  \RL                  " \R^                  5      \R>                  \RL                  " \R`                  5      \RB                  \RL                  " \Rb                  5      \RF                  \RL                  " \Rd                  5      \RH                  0	Er3\3Ri                  5        V Vs0 s H  u  pX_M	     snn r50 \Rl                  S_\R4                  S _\R*                  S!_\R                  S"_\R(                  S#_\R6                  S$_\R:                  S%_\R8                  S&_\R<                  S'_\RD                  S(_\RB                  S)_\R0                  S*_\R2                  S+_\RF                  S,_\R@                  S-_\R                  S._\R                   S/_\R"                  S0\R$                  S1\R&                  S2\RH                  S3\R>                  S4\R                  S5\R                  S6\R,                  S7\R.                  S8\RN                  S90
Er7\7Ri                  5        V Vs0 s H  u  pX_M	     snn r8gs  snn f s  snn f ):z)ONNX IR enums that matches the ONNX spec.    )annotationsN)Anyc                  h    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSS jrSS jrSrg)AttributeType   z&Enum for the types of ONNX attributes.r                           	   
            c                    U R                   $ Nnameselfs    M/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/onnx_ir/_enums.py__repr__AttributeType.__repr__!       yy    c                "    U R                  5       $ r   r   r   s    r   __str__AttributeType.__str__$       }}r    Nreturnstr)__name__
__module____qualname____firstlineno____doc__	UNDEFINEDFLOATINTSTRINGTENSORGRAPHFLOATSINTSSTRINGSTENSORSGRAPHSSPARSE_TENSORSPARSE_TENSORS
TYPE_PROTOTYPE_PROTOSr   r"   __static_attributes__r%   r   r   r   r      sZ    0IE
CFFEFDGGFMNJKr   r   c                     \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr\ S4S j5       r!\ S5S j5       r"\#S6S  j5       r$\#S7S! j5       r%\#S7S" j5       r&\#S7S# j5       r'\#S8S$ j5       r(\#S8S% j5       r)\#S8S& j5       r*\#S8S' j5       r+\#S7S( j5       r,\#S8S) j5       r-S9S* jr.S:S+ jr/S;S, jr0S;S- jr1S;S. jr2S;S/ jr3S:S0 jr4S:S1 jr5S2r6g3)<DataType(   zIEnum for the data types of ONNX tensors, defined in ``onnx.TensorProto``.r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r                                       c                   U[         ;   a  U " [         U   5      $ [        R                  " U[        R                  5      (       d*  [        R                  " U[        R                  5      (       a  [
        R                  $ [        US5      (       Ga@  UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S:X  a  [
        R                  $ UR                  S	:X  a  [
        R                   $ UR                  S
:X  a  [
        R"                  $ UR                  S:X  a  [
        R$                  $ ['        SU 35      e)zsReturns the ONNX data type for the numpy dtype.

Raises:
    TypeError: If the data type is not supported by ONNX.
names)bfloat16)e4m3fn)e4m3fnuz)e5m2)e5m2fnuz)uint4)int4)
float4e2m1)int2)uint2zUnsupported numpy data type: )_NP_TYPE_TO_DATA_TYPEnp
issubdtypestr_bytes_r?   r1   hasattrrN   BFLOAT16FLOAT8E4M3FNFLOAT8E4M3FNUZ
FLOAT8E5M2FLOAT8E5M2FNUZUINT4INT4
FLOAT4E2M1INT2UINT2	TypeError)clsdtypes     r   
from_numpyDataType.from_numpyI   s[    )),U344==((BMM%,K,K??"
 5'""{{m+((({{k),,,{{m+...{{i'***{{m+...{{j(~~%{{i'}}${{o-***{{i'}}${{j(~~%7w?@@r   c                P    U[         ;  a  [        SU 35      eU " [         U   5      $ )z}Returns the ONNX data type for the short name.

Raises:
    TypeError: If the short name is not available for the data type.
zUnknown short name: )_SHORT_NAME_TO_DATA_TYPEri   )rj   
short_names     r   from_short_nameDataType.from_short_namep   s1     552:,?@@+J788r   c                     U R                   S-  $ )z+Returns the size of the data type in bytes.r   )bitwidthr   s    r   itemsizeDataType.itemsize{   s     }}q  r   c                D    U [         ;  a  [        SU  35      e[         U    $ )z|Returns the bit width of the data type.

.. versionadded:: 0.1.2

Raises:
    TypeError: If the data type is not supported.
z+Bitwidth not available for ONNX data type: )_BITWIDTH_MAPri   r   s    r   rt   DataType.bitwidth   s*     }$I$PQQT""r   c                    U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ [        SU  35      e)zReturns the bit width of the exponent for floating-point types.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not supported.
z+Exponent not available for ONNX data type: )is_floating_point	ml_dtypesfinfonumpynexpri   r   s    r   exponent_bitwidthDataType.exponent_bitwidth   sA     !!##??4::<0555EdVLMMr   c                    U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ [        SU  35      e)zReturns the bit width of the mantissa for floating-point types.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not supported.
z+Mantissa not available for ONNX data type: )r{   r|   r}   r~   nmantri   r   s    r   mantissa_bitwidthDataType.mantissa_bitwidth   sA     !!##??4::<0666EdVLMMr   c                    U R                  5       (       a  gU R                  5       (       a.  [        R                  " U R	                  5       5      R
                  $ [        SU  35      e)zReturns the difference between 1.0 and the next smallest representable float larger than 1.0 for the ONNX data type.

Returns 1 for integers.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
r   z&Eps not available for ONNX data type: )
is_integerr{   r|   r}   r~   epsri   r   s    r   r   DataType.eps   sQ     ??!!##??4::<0444@GHHr   c                    U R                  5       (       a  gU R                  5       (       a.  [        R                  " U R	                  5       5      R
                  $ [        SU  35      e)zReturns the smallest positive non-zero value for the ONNX data type.

Returns 1 for integers.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
r   z'Tiny not available for ONNX data type: )r   r{   r|   r}   r~   tinyri   r   s    r   r   DataType.tiny   sQ     ??!!##??4::<0555A$HIIr   c                *   U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ [        SU  35      e)zReturns the minimum representable value for the ONNX data type.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
z*Minimum not available for ONNX data type: )r   r|   iinfor~   minr{   r}   ri   r   s    r   r   DataType.min   i     ????4::<0444!!##??4::<0444DTFKLLr   c                *   U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ U R                  5       (       a.  [        R                  " U R                  5       5      R                  $ [        SU  35      e)zReturns the maximum representable value for the ONNX data type.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
z*Maximum not available for ONNX data type: )r   r|   r   r~   maxr{   r}   ri   r   s    r   r   DataType.max   r   r   c                    U R                  5       (       a  gU R                  5       (       a.  [        R                  " U R	                  5       5      R
                  $ [        SU  35      e)a  Returns the precision for the ONNX dtype if supported.

For floats returns the approximate number of decimal digits to which
this kind of float is precise. Returns 0 for integers.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
r   z,Precision not available for ONNX data type: )r   r{   r|   r}   r~   	precisionri   r   s    r   r   DataType.precision   sQ     ??!!##??4::<0:::FtfMNNr   c                    U R                  5       (       a  gU R                  5       (       a.  [        R                  " U R	                  5       5      R
                  $ [        SU  35      e)zReturns the resolution for the ONNX dtype if supported.

Returns the approximate decimal resolution of this type, i.e.,
 10**-precision. Returns 1 for integers.

.. versionadded:: 0.1.8

Raises:
    TypeError: If the data type is not a numeric data type.
r   z-Resolution not available for ONNX data type: )r   r{   r|   r}   r~   
resolutionri   r   s    r   r   DataType.resolution  sQ     ??!!##??4::<0;;;GvNOOr   c                D    U [         ;  a  [        SU  35      e[         U    $ )ztReturns the numpy dtype for the ONNX data type.

Raises:
    TypeError: If the data type is not supported by numpy.
z'Numpy does not support ONNX data type: )_DATA_TYPE_TO_NP_TYPEri   r   s    r   r~   DataType.numpy  s+     ,,EdVLMM$T**r   c                D    U [         ;  a  [        SU  35      e[         U    $ )a  Returns the short name of the data type.

The short name is a string that is used to represent the data type in a more
compact form. For example, the short name for `DataType.FLOAT` is "f32".
To get the corresponding data type back, call ``from_short_name`` on a string.

Naming reference: https://github.com/pytorch/pytorch/blob/4bead7b85ea4160243c74109e0ce9bb80686d016/torch/utils/_dtype_abbrs.py

Raises:
    TypeError: If the short name is not available for the data type.
z-Short name not available for ONNX data type: )_DATA_TYPE_TO_SHORT_NAMEri   r   s    r   rp   DataType.short_name#  s+     //KD6RSS'--r   c                8   U [         R                  [         R                  [         R                  [         R                  [         R
                  [         R                  [         R                  [         R                  [         R                  [         R                  1
;   $ )z7Returns True if the data type is a floating point type.)r?   r/   FLOAT16DOUBLEr_   r`   ra   rb   rc   rf   
FLOAT8E8M0r   s    r   r{   DataType.is_floating_point3  sj    NNOO!!####
 
 	
r   c                t   U [         R                  [         R                  [         R                  [         R                  [         R
                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  1;   $ )zFReturns True if the data type is an integer.

.. versionadded:: 0.1.4
)r?   UINT8INT8UINT16INT16INT32INT64UINT32UINT64rd   re   rg   rh   r   s    r   r   DataType.is_integerB  sj    
 NNMMOONNNNNNOOOONNMMMMNN
 
 	
r   c                (   U [         R                  [         R                  [         R                  [         R                  [         R
                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                   [         R"                  [         R$                  1;   $ )zIReturns True if the data type is a signed type.

.. versionadded:: 0.1.4
)r?   r/   r   r   r   r   r   r   	COMPLEX64
COMPLEX128r_   r`   ra   rb   rc   re   rf   r   rg   r   s    r   	is_signedDataType.is_signedV  s    
 NNMMNNNNNNOO!!####MMMM%
 
 	
r   c                (    U [         R                  :H  $ )zIReturns True if the data type is a string type.

.. versionadded:: 0.1.8
)r?   r1   r   s    r   	is_stringDataType.is_stringp  s    
 x&&r   c                    U R                   $ r   r   r   s    r   r   DataType.__repr__w  r   r   c                "    U R                  5       $ r   r!   r   s    r   r"   DataType.__str__z  r$   r   r%   N)rk   np.dtyper'   r?   )rp   r(   r'   r?   )r'   float)r'   int)r'   zint | np.floating[Any])r'   r   r&   )r'   bool)7r)   r*   r+   r,   r-   r.   r/   r   r   r   r   r   r   r1   BOOLr   r   r   r   r   r   r_   r`   ra   rb   rc   rd   re   rf   r   rh   rg   classmethodrl   rq   propertyru   rt   r   r   r   r   r   r   r   r   r~   rp   r{   r   r   r   r   r"   r=   r%   r   r   r?   r?   (   s   S IEEDFEEEFDGFFFIJHLNJNEDJJED$A $AL 9 9 ! ! 
# 
# N N N N I I$ J J$ M M  M M  O O& P P&+. 

(
4'r   r?       r   rB   @      r   r	   r   
complex128	complex64float16float32float64int16int32int64int8objectuint16uint32uint64uint8	undefinedbf16f64f32f16f8e4m3fnf8e5m2
f8e4m3fnuz
f8e5m2fnuzf8e8m0f4e2m1c64c128i2i4i8i16i32i64b8u2u4u8u16u32u64s)9r-   
__future__r   enumtypingr   r|   r~   rZ   IntEnumr   r?   r/   r   r   r   r   r   r   r   r   r   r   r   r   r   r_   r`   ra   rb   rc   rd   re   rf   r   rg   rh   rx   rk   r1   rO   float8_e4m3fnfloat8_e4m3fnuzfloat8_e5m2float8_e5m2fnuzfloat8_e8m0fnurU   rT   float4_e2m1fnrW   rX   rY   itemsr   r.   r   ro   )kvs   00r   <module>r      s=   0 "    DLL 4St|| Sl
NNBNNA MM1 OOR	
 NNB NNB NNB MM1 b OOR OOR OOR   r  1!" Q#$ QNNAMM1MM1NNA3<HHVhmmHH\H// HH[8-- HHY))	
 HHY HHY HHWx~~ HHWx~~ HHWx~~ HHVhmm HHX HHX HHX HHX HHWx~~  HHY ("3"3!" HHY$$%x'<'<#$ HHY&&')@)@HHY""#X%8%8HHY&&')@)@HHY%%&(;(;HHY^^hmmHHY__x~~HHY$$%x':':HHY^^hmmHHY__x~~5 < +@*E*E*GH*G$!*GH v OOU NNE	
 e :  \ \     MM4 MM4  MM4!" NNE#$ NNENNEMM4NNDNNDNNDOOUOOUOOUOOS7 < .F-K-K-MN-MTQAD-MN A I@ Os   4Z2Z