
    bIgn                       d dl mZ d dlZd dlmZmZ d dlZd dlm	Z
 d dlmZmZmZmZmZmZ d dlmZmZ ddZ	 d	 	 	 	 	 ddZdd
Z ej0                  edd	g      Z	 	 	 d 	 	 	 	 	 	 	 	 	 d!dZddZ ej0                  edd	g      Z	 	 	 d"	 	 	 	 	 	 	 	 	 d!dZ	 	 	 	 	 	 	 	 d#dZd$d%dZd$d%dZ dd&dZ!dd'dZ"d(dZ#	 d)	 	 	 	 	 	 	 d*dZ$d+dZ%dd,dZ&d-dZ'	 d)	 	 	 	 	 	 	 d.dZ(d/dZ)	 d0	 	 	 	 	 	 	 d1dZ*y)2    )annotationsN)AnySequence)MapProtoOptionalProtoSequenceProtoTensorProtohelpersubbyte)load_external_data_for_tensoruses_external_datac           	         t        t        |       dz        D cg c]  }t        | |dz     | |dz  dz             c}S c c}w )N      )rangelencomplex)fais     N/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/numpy_helper.pycombine_pairs_to_complexr      s>    7<SW\7JK!GBq1uIr!a%!)}-KKKs   "?c                   d }|t        | j                        dk(  rY |t        j                  | g      j	                  t        j
                              j                  t        j                        d   S  || j	                  t        j
                              j                  t        j                        S  || j	                  t        j
                              j                  |      j                  t        j                        S )a_  Converts ndarray of bf16 (as uint32) to f32 (as uint32).

    Args:
        data: A numpy array, empty dimensions are allowed if dims is
            None.
        dims: If specified, the function reshapes the results.

    Returns:
        A numpy array of float32 with the same dimension if dims is
        None, or reshaped to dims if specified
    c                    | dz  S )N    )xs    r   <lambda>z%bfloat16_to_float32.<locals>.<lambda>#   s
    a2g     r   )	r   shapenparrayastypeint32viewfloat32reshape)datadimsshifts      r   bfloat16_to_float32r*      s     E|tzz?a4&)00:;@@LQOOT[[*+00<<RXX&'//5::2::FFr   fnuzc                   |st        d      | dk  s| dkD  rt        |  d      |rd}| dk(  rct        j                  S d}| dk(  r$t        j                  t        j                         S | dk(  r#t        j                  t        j                        S t        j
                  |       } | d	z  d
z	  }| dz  }| dz  }|dz  }|dk(  rL|dkD  r_d|z
  }|dz  dk(  r|d
z  }|dz  }|dz  }|dz  dk(  r|d
z  }|dz  }|dz  }||d
z  dz  z  }||dz  z  }n||dz  z  }|d|z
  z  }||dz  z  }t        j
                  |      j                  t        j                        }|S )Nzfn=False is not implemented.r      z is not a float8.            x            r            )NotImplementedError
ValueErrorr    nanr%   uint32r$   	ivalr+   r,   exponent_biasexpomantsignresfs	            r   _float8e4m3_to_float32_scalarrF   +   s   !"@AAax4#:D6!2344	4<66M3;::rvvg&&3;::bff%%99T?D4KAD$;D$;D
"*Cqy!8-'DczQ
	czQ
	D3J2%%C42:Ctrz}$$trz
		#BJJ'AHr   )excludedc                b    |st        d      t        | ||      }||S |j                  |      S )a  Converts ndarray of float8, e4m3 (as uint32) to f32 (as uint32).

    See :ref:`onnx-detail-float8` for technical details.

    Args:
        data: A numpy array, empty dimensions are allowed if dims is None.
        dims: If specified, the function reshapes the results.
        fn: No infinite values.
        uz: No negative zero.

    Returns:
        A numpy array of float32 with the same dimension if dims is None,
        or reshaped to dims if specified.
    z4float32_to_float8e4m3 not implemented with fn=False.r+   r,   )r:   _float8e4m3_to_float32r&   r'   r(   r+   r,   rD   s        r   float8e4m3_to_float32rL   Z   s@    ( !B
 	
 !"
4C|
;;tr   c                (   |r-|r+| dk(  r#t        j                  t         j                        S d}n|s|s| dv r$t        j                  t         j                         S | dv r#t        j                  t         j                        S | dk(  r$t        j                  t         j                         S | dk(  r#t        j                  t         j                        S d}nt	        d      t        j
                  |       } | dz  d	z	  }| d
z  }| dz  }|dz  }|dk(  r5|dkD  rHd|z
  }|d	z  dk(  r|dz  }|dz  }|dz  }||dz  dz  z  }||dz  z  }n||dz  z  }|d|z
  z  }||dz  z  }t        j
                  |      j                  t         j                        }|S )Nr0   r   >         r.   >   }   ~   r2      |      z%fn and uz must be both False or True.r   r4   r5   r   r2   r      r8   r7   )r    r%   r<   infr:   r=   r$   r>   s	            r   _float8e5m2_to_float32_scalarrW   x   s   	b4<::bff%%?"::rvvg&&?"::bff%%3;::rvvg&&3;::bff%%!"IJJ99T?D4KAD$;D$;D
"*Cqy!8-'DczQ
	D3J2%%C42:Ctrz}$$trz
		#BJJ'AHr   c                H    t        | ||      }||S |j                  |      S )a  Converts ndarray of float8, e5m2 (as uint32) to f32 (as uint32).

    See :ref:`onnx-detail-float8` for technical details.

    Args:
        data: A numpy array, empty dimensions are allowed if dims is None.
        dims: If specified, the function reshapes the results.
        fn: No infinite values.
        uz: No negative zero.

    Returns:
        A numpy array of float32 with the same dimension if dims is None,
        or reshaped to dims if specified
    rI   )_float8e5m2_to_float32r&   rK   s        r   float8e5m2_to_float32rZ      s+    ( !"
4C|
;;tr   c                   fd}t        j                  |dd      } || j                               \  }}t        j                  |j                  |j                  z   ft         j
                        }||ddd<   ||ddd<   |j                  t        j                  |      dz   k(  r|j                         dd }|j                  |      }|S )a  Converts ndarray of int4 (as packed uint8) to f32
    See :ref:`onnx-detail-int4` for technical details.

    Args:
        data: A numpy array, empty dimensions are allowed if dims is
            None.
        dims: The dimensions are used to reshape the unpacked buffer
        signed: Whether the 4 bit integer is signed or unsigned

    Returns:
        A numpy array of float32 reshaped to dims.
    c                0    t        j                  |       S N)r   unpack_single_4bitx2)r   signeds    r   r   zunpack_int4.<locals>.<lambda>   s    G88FC r   r   r   dtyper   N)r    
frompyfuncravelemptysizer%   prodr&   )r'   r(   r_   single_funcfuncres_highres_lowrD   s     `     r   unpack_int4rl      s    " DK==a+DTZZ\*Hg
((HMMGLL02"**
ECC1IC1I 	BGGDMA%%iik#2
++d
CJr   c                >   | j                  d      rt        d      | j                  t        j                  k(  rt        d      | j                  }t        j                  |      }t        j                  t        j                  |            }t        j                  |      }| j                  }| j                  t        j                  k(  r]t        | |      }|D cg c]  }|j                  d       }	}t        j                  |	      j!                  |      j#                  |      S t%        |       rt'        | |       | j                  d      r]| j(                  }
t*        j,                  dk(  r3t        j.                  |
|      j1                         j3                         }
|t        j4                  k(  r1t        j.                  |
t        j6                        }t9        ||      S |t        j:                  k(  r1t        j.                  |
t        j<                        }t?        ||      S |t        j@                  k(  r3t        j.                  |
t        j<                        }t?        ||d	      S |t        jB                  k(  r1t        j.                  |
t        j<                        }tE        ||      S |t        jF                  k(  r4t        j.                  |
t        j<                        }tE        ||dd
      S |t        jH                  k(  r3t        j.                  |
t        jJ                        }tM        ||d      S |t        jN                  k(  r3t        j.                  |
t        j<                        }tM        ||d      S t        j.                  |
|      j#                  |      S |t        jP                  k(  r[t        j                  | jR                  t        jT                        j#                  |      jW                  t        jX                        S |t        j4                  k(  r;t        j                  | jR                  t        jZ                        }t9        ||      S |t        j:                  k(  r;t        j                  | jR                  t        jZ                        }t?        ||      S |t        j@                  k(  r=t        j                  | jR                  t        jZ                        }t?        ||d	      S |t        jB                  k(  r;t        j                  | jR                  t        jZ                        }tE        ||      S |t        jF                  k(  r>t        j                  | jR                  t        jZ                        }tE        ||dd
      S |t        jH                  k(  r/t        j                  | jR                  |      }tM        ||d      S |t        jN                  k(  r/t        j                  | jR                  |      }tM        ||d      S t        | |      }|t        j\                  t        j^                  fv rta        |      }t        j                  ||      j!                  |      j#                  |      S c c}w )zConverts a tensor def object to a numpy array.

    Args:
        tensor: a TensorProto object.
        base_dir: if external tensor exists, base_dir can help to find the path to it

    Returns:
        arr: the converted array.
    segmentz*Currently not supporting loading segments.z4The element type in the input tensor is not defined.utf-8raw_databigr`   T)r,   rI   F)r_   )1HasFieldr;   	data_typer	   	UNDEFINED	TypeErrorr
   tensor_dtype_to_np_dtype$tensor_dtype_to_storage_tensor_dtypetensor_dtype_to_fieldr(   STRINGgetattrdecoder    asarrayr"   r&   r   r   rp   sys	byteorder
frombufferbyteswaptobytesBFLOAT16int16r*   FLOAT8E4M3FNint8rL   FLOAT8E4M3FNUZ
FLOAT8E5M2rZ   FLOAT8E5M2FNUZUINT4uint8rl   INT4FLOAT16
int32_datauint16r$   float16r#   	COMPLEX64
COMPLEX128r   )tensorbase_dirtensor_dtypenp_dtypestorage_np_dtypestorage_fieldr(   utf8_stringssssrp   r'   s               r   	_to_arrayr      s    y!EFF;000NOO##L..|<H6633LA 00>M;;D;---v}5)56Aahhw66zz"~$$X.66t<< &!%fh7z"??==E!}}XX>GGIQQSH ;///==:D&tT22;333==9D(t44;555==9D(t==;111==9D(t44;555==9D(tFF;,,,==:DtT%88;+++==9DtT$77}}XX6>>tDD {***JJv((		:WT]T"**	
 {+++zz&++288<"4..{///zz&++288<$T400{111zz&++288<$T4D99{---zz&++288<$T400{111zz&++288<$T4DTBB{(((zz&++3CD4e44{'''zz&++3CD4d336=)D--{/E/EFF'-::d"23::8DLLTRRm 7s   Zc                   | j                   }|t        j                  k(  rt        |       rt	        | |       | j
                  }t        | j                        }t        j                  |t        j                        j                         }t        |      D ]
  \  }}|||<    |j                  |      S |t        j                  t        j                   t        j"                  t        j$                  fv r!t        j                  t        j&                  t        j                   t        j(                  t        j"                  t        j*                  t        j$                  t        j,                  i}t        |       rt	        | |       | j/                  d      r| j0                  }n| j
                  }t        | j                        }t        j                  |||         j                         }t        |      D ]
  \  }}|||<    |j                  |      S |t        j2                  t        j4                  fv rt        |       rt	        | |       | j/                  d      r| j0                  }n| j
                  }t        | j                        }t        j4                  t        j6                  t        j2                  t        j8                  i}||   }	|t        j4                  k(  }
t        j                  t;        |      t        j<                        j                         }t        |      D ]
  \  }}|||<    t?        |||
      }|jA                  |	      S tC        | |      S )a+  Converts a tensor def object to a numpy array.
    Supports types defined in :mod:`onnx._custom_element_types`.

    Args:
        tensor: a TensorProto object.
        base_dir: if external tensor exists, base_dir can help to find the path to it

    Returns:
        arr: the converted array.
    r`   rp   )r(   r_   )r   )"rs   r	   r   r   r   r   tupler(   r    re   custom_np_typesbfloat16rd   	enumerater&   r   r   r   r   float8e4m3fnfloat8e4m3fnuz
float8e5m2float8e5m2fnuzrr   rp   r   r   int4uint4r   r   rl   r"   r   )r   r   	elem_typer'   r   yr   dmra   r_   unpacked_datas               r   to_arrayr   R  s      IK(((f%)&(;  fkk"HHU/":":;AACdO 	DAqAaD	yy  """"	  $$o&B&B&&(F(F""O$>$>&&(F(F	
 f%)&(;??:&??D$$Dfkk"HHU!I,/557dO 	DAqAaD	yy[&&(8(899f%)&(;??:&??D$$Dfkk"o2244
 )k... HHSYbhh/557dO 	DAqAaD	#AE&A##E**Vh//r   c           	        t        | t        j                  t        j                  f      st	        dt        |              t               }|j                  j                  | j                         |r||_
        | j                  t        k(  s/t        j                  | j                  t        j                        rKt        j                   | j                        |_        | j%                         }|D ]  }t        |t&              r+|j(                  j+                  |j-                  d             ?t        |t        j                        ro|D ]i  }t        |t&              r+|j(                  j+                  |j-                  d             >t        |t.              sO|j(                  j+                  |       k t        |t.              r|j(                  j+                  |       t1        dt'        t        |                   |S 	 t        j                   | j                        }||_        | j7                         |_        t:        j<                  dk(  rt?        |       |S # t2        $ r}t5        d| j                        |d}~ww xY w)zConverts a numpy array to a tensor def.

    Args:
        arr: a numpy array.
        name: (optional) the name of the tensor.

    Returns:
        TensorProto: the converted tensor def.
    z2arr must be of type np.generic or np.ndarray, got ro   zMUnrecognized object in the object array, expect a string, or array of bytes: z$Numpy data type not understood yet: Nrq   ) 
isinstancer    ndarraygenericru   typer	   r(   extendr   namera   object
issubdtypestr_r
   np_dtype_to_tensor_dtypers   flattenstrstring_dataappendencodebytesr:   KeyErrorRuntimeErrorr   rp   r}   r~   convert_endian)arrr   r   
flat_arrayer   ra   s          r   _from_arrayr     s    cBJJ

34@cL
 	
 ]F
KKsyy!
yyFbmmCIIrww?!::399E [[]
 	A!S!""))!((7*;<Arzz* 5A!!S)**11!((72CD#Au-**11!4	5
 Au%""))!,)cQL 	  X//		: FkkmFO
}}vM  XA#))OPVWWXs   I# #	J
,JJ
c                |   t        | t        j                        st        | |      S | j                  }|t
        j                  k(  r7|j                  d   d   dk(  r"t        j                  }t        j                  }n|t
        j                  k(  r7|j                  d   d   dk(  r"t        j                  }t        j                  }nz|t
        j                  k(  r7|j                  d   d   dk(  r"t        j                  }t        j                  }n0|t
        j                  k(  r6|j                  d   d   dk(  r!t        j                   }t        j                  }n|t
        j"                  k(  r6|j                  d   d   dk(  r!t        j$                  }t        j&                  }n|t
        j(                  k(  r6|j                  d   d   dk(  r!t        j*                  }t        j,                  }nU|t
        j.                  k(  r6|j                  d   d   dk(  r!t        j0                  }t        j                  }nt        | |      S |t        j0                  t        j*                  fv r| j3                  |      j5                         }|j6                  d	z  d
k(  rt9        d| j:                   d      |ddd	   dz  |d
dd	   dz  z   }t               }|j<                  j?                  | j:                         |r||_         |jC                         |_"        ||_#        |S t        | j3                  |      |      }||_#        |S )a  Converts an array into a TensorProto including
    supported type defined in :mod:`onnx._custom_element_types`.

    Args:
        tensor: a numpy array.
        name: (optional) the name of the tensor.

    Returns:
        TensorProto: the converted tensor def.
    r   e4m3fne4m3fnuze5m2e5m2fnuzr   r   r   r   r   zIThe conversion of a tensor of INT4 or UINT4 requires an even size (shape=z+). Every byte stores two INT4 or two UINT4.NrT   r6   )$r   r    r   r   ra   r   r   descrr	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r"   rd   rf   r;   r   r(   r   r   r   rp   rs   )	r   r   dttodt_tovaluebufferpbts	            r   
from_arrayr     s    fbjj)64((	B	_)))bhhqk!n.H%%	--	-"((1+a.J2N''	))	)bhhqk!n.F##	--	-"((1+a.J2N''	''	'BHHQKNj,H!!			##	#A&(@	$$	$!Q7)B64((	k!1!122e$**,::>Q ,,'RT  !*t#addq(89]
v||$BGnn&	FMM%($/AAKHr   c                   | j                   }|t        j                  k(  r#| j                  D cg c]  }t	        |       c}S |t        j
                  k(  r#| j                  D cg c]  }t	        |       c}S |t        j                  k(  r#| j                  D cg c]  }t        |       c}S |t        j                  k(  r#| j                  D cg c]  }t        |       c}S t        d      c c}w c c}w c c}w c c}w )zConverts a sequence def to a Python list.

    Args:
        sequence: a SequenceProto object.

    Returns:
        list: the converted list.
    z8The element type in the input sequence is not supported.)r   r   TENSORtensor_valuesr   SPARSE_TENSORsparse_tensor_valuesSEQUENCEsequence_valuesto_listMAP
map_valuesto_dictru   )sequencer   vs      r   r   r     s     ""IM(((%-%;%;<<<M///%-%B%BCCCM***$,$<$<=q
==M%%%$,$7$78q
88
N
OO =C=8s   C0$C5C:C?c                $    t               }|r||_        |r|}nvt               dkD  rX d   }t        |t              rt         j
                  }nBt        |t              rt         j                  }n!t         j                  }nt         j                  }||_	        t               dkD  rt         fd D              st        d      |t         j                  k(  r. D ]'  }|j                  j                  t        |      g       ) |S |t         j                  k(  r. D ]'  }|j                  j                  t!        |      g       ) |S |t         j
                  k(  r. D ]'  }|j"                  j                  t%        |      g       ) |S t        d      )a]  Converts a list into a sequence def.

    Args:
        lst: a Python list
        name: (optional) the name of the sequence.
        dtype: (optional) type of element in the input list, used for specifying
                          sequence values when converting an empty list.

    Returns:
        SequenceProto: the converted sequence def.
    r   c              3  N   K   | ]  }t        |t        d                  yw)r   N)r   r   ).0elemlsts     r   	<genexpr>zfrom_list.<locals>.<genexpr>O  s      !QT*T4A<"@!Q   "%zqThe element type in the input list is not the same for all elements and therefore is not supported as a sequence.zZThe element type in the input list is not a tensor, sequence, or map and is not supported.)r   r   r   r   dictr   listr   r   r   allru   r   r   r   r   	from_listr   	from_dict)	r   r   ra   r   r   
first_elemr   seqmappings	   `        r   r   r   -  s    H		SAV
j$'%))I
D)%..I%,,I "((	"HC1c!QS!QQM
 	

 M((( 	@F"")):f+=*>?	@ O 
m,,	, 	>C$$++Ys^,<=	> O 
m''	' 	=G&&	'(:';<	= O	 5
 	
r   c                J   g }| j                   t        j                  k(  rt        | j                        }nt        | j
                        }t        | j                        }t        |      t        |      k7  rt        d| j                  d      t        t        ||            }|S )zConverts a map def to a Python dictionary.

    Args:
        map_proto: a MapProto object.

    Returns:
        The converted dictionary.
    z2Length of keys and values for MapProto (map name: z) are not the same.)key_typer	   ry   r   string_keyskeysr   valuesr   
IndexErrorr   r   zip)	map_protokey_list
value_list
dictionarys       r   r   r   f  s     H[///	--.	'))*J
8}J'@NN!
 	

 c(J/0Jr   c                h  	 t               }|r||_        t        |       }t        j                  |d         t        j                        }t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  g}t!        fd|D              st#        d      t        | j%                               }t        j                  |d         	t!        	fd|D              st#        d      t'        |      }||_        |t        j*                  k(  r|j,                  j/                  |       n||v r|j0                  j/                  |       |j$                  j3                  |       |S )zConverts a Python dictionary into a map def.

    Args:
        dict_: Python dictionary
        name: (optional) the name of the map.

    Returns:
        MapProto: the converted map def.
    r   c              3  N   K   | ]  }t        j                  |      k(    y wr]   r    result_type)r   keyraw_key_types     r   r   zfrom_dict.<locals>.<genexpr>  s'      
 NN3</
r   zfThe key type in the input dictionary is not the same for all keys and therefore is not valid as a map.c              3  N   K   | ]  }t        j                  |      k(    y wr]   r   )r   valraw_value_types     r   r   zfrom_dict.<locals>.<genexpr>  s     Gr~~c"n4Gr   zjThe value type in the input dictionary is not the same for all values and therefore is not valid as a map.)r   r   r   r    r   r
   r   r	   INT8INT16INT32INT64UINT8UINT16UINT32UINT64r   ru   r   r   r   ry   r   r   r   CopyFrom)
dict_r   r   r   r   valid_key_int_typesr   	value_seqr   r  s
           @@r   r   r     so    
I	;D>>$q'*L..|<H 		 	 

 	

 @
 	

 %,,.!F^^F1I.NGGGB
 	

 &!I!I;%%%$$T*	(	(d#i(r   c                   | j                   }|t        j                  k(  ry|t        j                  k(  rt	        | j
                        S |t        j                  k(  rt	        | j                        S |t        j                  k(  rt        | j                        S |t        j                  k(  rt        | j                        S |t        j                  k(  rt        | j                         S t#        d      )zConverts an optional def to a Python optional.

    Args:
        optional: an OptionalProto object.

    Returns:
        opt: the converted optional.
    Nz8The element type in the input optional is not supported.)r   r   rt   r   r   tensor_valuer   sparse_tensor_valuer   r   sequence_valuer   r   	map_valueOPTIONALto_optionaloptional_valueru   )optionalr   s     r   r  r    s     ""IM+++M(((--..M///4455M***x..//M%%%x))**M***82233
N
OOr   c                   t               }|r||_        |r<t        t         j                  j	                               }||vrt        | d      |}net        | t              rt         j                  }nDt        | t              rt         j                  }n#| t         j                  }nt         j                  }||_        | |t         j                  k(  r&|j                  j                  t        |              |S |t         j                  k(  r&|j                   j                  t#        |              |S |t         j                  k(  r&|j$                  j                  t'        |              |S t        d      |S )a  Converts an optional value into a Optional def.

    Args:
        opt: a Python optional
        name: (optional) the name of the optional.
        dtype: (optional) type of element in the input, used for specifying
                          optional values when converting empty none. dtype must
                          be a valid OptionalProto.DataType value

    Returns:
        optional: the converted optional def.
    z( must be a valid OptionalProto.DataType.zUThe element type in the input is not a tensor, sequence, or map and is not supported.)r   r   r   DataTyper   ru   r   r   r   r   rt   r   r   r  r  r   r  r   r  r   )optr   ra   r  valid_dtypesr   s         r   from_optionalr    sI     HM2299;<$ug%MNOO		C	!%%		C	!**		!++	!((	"H
,,,!!**:c?; O -000##,,Ys^< O -+++''	#7 O	 9  Or   c                    | j                   }t        j                  |      }t        j                  | j
                  |      j                         j                         | _        y)znCall to convert endianness of raw data in tensor.

    Args:
        tensor: TensorProto to be converted.
    r`   N)rs   r
   rv   r    r   rp   r   r   )r   r   r   s      r   r   r     sJ     ##L..|<H
fooX6??AIIK Or   c           	        t         j                  j                  |       |t         j                  t         j                  t         j
                  t         j                  t         j                  t         j                  t         j                  t         j                  fv rt        t        j                  |      j                  t        j                  t         j                        j                        }t        t        j                  |      j                  t        j                  t         j                        j                        }t         j                  j                  |||       j                  |      S t!        | d      )a'  Create random integer array for backend/test/case/node.

    Args:
        input_shape: The shape for the returned integer array.
        dtype: The NumPy data type for the returned integer array.
        seed: The seed for np.random.

    Returns:
        np.ndarray: Random integer array.
    )rf   z' is not supported by create_random_int.)r    randomseedr   r   r=   uint64r   r   r#   int64miniinfomaxrandintr"   ru   )input_shapera   r   endstarts        r   create_random_intr*    s     IINN4

		
		
		



	 	 "((5/%%rxx'9'='=>BHHUO''"(();)?)?@yy  + >EEeLL5'!HIJJr   )r   zSequence[int]returnzlist[complex]r]   )r'    np.int16 | np.int32 | np.ndarrayr(   int | Sequence[int] | Noner+  
np.ndarray)r?   intr+   boolr,   r0  r+  z
np.float32)NTF)
r'   r,  r(   r-  r+   r0  r,   r0  r+  r.  )NFF)r'   znp.int32 | np.ndarrayr(   zint | Sequence[int]r_   r0  r+  r.  ) )r   r	   r   r   r+  r.  )r   r.  r   
str | Noner+  r	   )r   r.  r   r2  r+  r	   )r   r   r+  	list[Any])NN)r   r3  r   r2  ra   
int | Noner+  r   )r   r   r+  dict[Any, Any])r  r5  r   r2  r+  r   )r  r   r+  
Any | None)r  r6  r   r2  ra   r4  r+  r   )r   r	   r+  None)r   )r'  z
tuple[int]ra   znp.dtyper   r/  r+  r.  )+
__future__r   r}   typingr   r   numpyr    onnx._custom_element_types_custom_element_typesr   onnxr   r   r   r	   r
   r   onnx.external_data_helperr   r   r   r*   rF   	vectorizerJ   rL   rW   rY   rZ   rl   r   r   r   r   r   r   r   r   r  r  r   r*  r   r   r   <module>r@     s   # 
    4 U U WL (,G
*G
$G G.'T &!T4L  (,	
*
$ 	 		
 <%P &!T4L  (,	
*
$ 	 		
 4

  	BoSdE0P>B:zP, BF6	6$64>66r47tP4 CG1	1%15?11h
 ;<KK$,K47KKr   