+
    9iL                          ^ RI t ^ RIt^ RIt^ RIHt ^RIHtHtHtH	t	H
t
 ^RIHt ^RIHt  ! R R]4      t  ! R R	]4      t  ! R
 R]4      t ! R R]4      tR# )    N)onnx_pb)TENSOR_NAME_QUANT_SUFFIXQuantizedValueQuantizedValueTypefind_by_nameget_mul_node)QuantOperatorBase)QDQOperatorBasec                   8   a a ] tR t^t oV 3R ltR tRtVtV ;t# )	QOpMatMulc                &   < \         SV `  W4       R # Nsuper__init__selfonnx_quantizer	onnx_node	__class__s   &&&g/var/www/html/photoedit/myenv/lib/python3.14/site-packages/onnxruntime/quantization/operators/matmul.pyr   QOpMatMul.__init__       3    c                J   V P                   P                  V P                  4      '       g1   \        P                  ! R V P                  P
                   R24       R# V P                   P                  V P                  P                  ^,          4      '       gm   V P                   P                  V P                  P                  ^ ,          4      '       g1   \        P                  ! RV P                  P
                   R24       R# V P                   P                  '       d   V P                   P                  V P                  P                  ^,          4      '       gH   \        P                  ! RV P                   P                   RV P                  P
                   R24       R# R# )zIgnore MatMul ]Fz&Ignore MatMul due to non float inputs z%Ignore MatMul due to non constant B: [T)	quantizershould_quantize_nodenodeloggingdebugnameis_float_tensorinputinfoq_matmul_const_b_onlyfind_initializer_in_pathgraph_scope)r   s   &r   should_quantizeQOpMatMul.should_quantize   s   ~~22499==MMN499>>*:!<=..tyyq/ABB..tyyq/ABBLLA$))..AQQRST >>///>>::499??1;MNNDT^^E_E_D``abfbkbkbpbpaqqrstr    )	__name__
__module____qualname____firstlineno__r   r*   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r      s     4 r   r   c                   8   a a ] tR t^(t oV 3R ltR tRtVtV ;t# )MatMulIntegerc                &   < \         SV `  W4       R # r   r   r   s   &&&r   r   MatMulInteger.__init__)   r   r   c                L   V P                   pVP                  R 8X  g   Q hV P                  P                  V^ .4      w  ppppV P                  P	                  V^.RRR7      w  pppp	VP                  V4       VP                  V4       VP                  V4       VP                  V	4       VP                  ^ ,          R,           p
VP                  '       d   VP                  R,           MRp\        P                  P                  RW#,           V
.V4      pVP                  V4       V
R,           pV P                  P                  VP                  ^ ,          RR7      p\        P                  P                  R	V
.V.V
R
,           VR7      pVP                  V4       \        V4      ^8X  g   Q hV'       d
   VR,           M$V^ ,          R,           V^,          ,           R,           p\        VV P                  P                  4      pVf&   \!        VVR,           V4      pVP                  V4       VP                  ^ ,          pRpV'       d
   VR,           pVP                  \!        VV.VP                  ^ ,          V4      4       V P                  ;P                  V,          un        R# )MatMulTreduce_rangeop_level_per_channel_output_quantized_quant r7   _cast_output)	mandatoryCast_cast)to_scales_mul__mulNz:0_output_scale_mul)r    op_typer   quantize_activationquantize_weightextendoutputr#   onnxhelper	make_nodeappendget_tensor_typelenr   	new_nodesr   )r   r    quantized_input_nameszero_point_namesscale_namesnodesquantized_input_names_weightzero_point_names_weightscale_names_weightnodes_weightmatmul_integer_outputmatmul_integer_namematmul_integer_nodecast_op_outputotype	cast_nodescales_mul_opscales_mul_nodescales_mul_op_outputoutput_scale_mul_ops   &                   r   quantizeMatMulInteger.quantize,   sk   yy||x''' NN..taS9	
! NN**4!4^b*c	
(#$$%AB 78-.\" $A1D D6:iiidii(2R"kk33!4"#	
 	() /?..t{{1~.NKK))"#!G+ * 
	 	Y ;1$$$ #  -/Q#%A6? 	 '}dnn6N6NO"*;8Lm\OLL).55a8 !"58K"K!56A#	
 	  E) r   r,   	r-   r.   r/   r0   r   ri   r1   r2   r3   r4   s   @@r   r7   r7   (   s     4G* G*r   r7   c                   >   a a ] tR t^{t oV 3R ltV 3R ltRtVtV ;t# )QLinearMatMulc                &   < \         SV `  W4       R # r   r   r   s   &&&r   r   QLinearMatMul.__init__|   r   r   c                N  < V P                   pVP                  R 8X  g   Q hV P                  P                  V^ .4      w  ppppV P                  P	                  V^.RRR7      w  pppp	VP                  V4       VP                  V4       VP                  V4       VP                  V	4       V P                  P                  VP                  ^ ,          4      w  p
ppppV
'       d   Vf   \        SV `%  4       # VP                  ^ ,          \        ,           pVP                  '       d   VP                  R,           MRp. pVP                  V^ ,          4       VP                  V^ ,          4       VP                  V^ ,          4       VP                  V^,          4       VP                  V^,          4       VP                  V^,          4       VP                  V4       VP                  V4       V P                  P                  \        P                  P                   \        P                  P"                  \        P                  P$                  \        P                  P&                  09   d   RMRp\(        P*                  P-                  RVV.VVR7      pVP                  V4       \/        VP                  ^ ,          VVV\0        P2                  4      pVV P                  P4                  VP                  ^ ,          &   V P                  ;P6                  V,          un        R# )	r;   Tr<   Nr@   rA   zcom.microsoftrm   )domain)r    rK   r   rL   rM   rN   _get_quantization_paramsrO   r   ri   r   r#   rS   weight_qType
onnx_protoTensorProtoFLOAT8E4M3FNFLOAT8E4M3FNUZ
FLOAT8E5M2FLOAT8E5M2FNUZrP   rQ   rR   r   r   Inputquantized_value_maprV   )r   r    rW   rX   rY   rZ   r[   r\   r]   r^   
data_foundoutput_scale_nameoutput_zp_namerH   qlinear_matmul_outputqlinear_matmul_nameqlinear_matmul_inputsrq   qlinear_matmul_nodeq_outputr   s   &                   r   ri   QLinearMatMul.quantize   s   yy||x''' NN..taS9	
! NN**4!4^b*c	
(#$$%AB 78-.\" NN33DKKNC	
2:7#%% $A1I I6:iiidii(2R "$$%:1%=>$$[^4$$%5a%89$$%:1%=>$$[^4$$%5a%89$$%67$$^4 ~~**&&33&&55&&11&&55	   	 #kk33!"# 4 
 	() "KKN!$$
 >F**4;;q>:  E) r   r,   rk   r4   s   @@r   rm   rm   {   s     4N* N*r   rm   c                   8   a a ] tR t^t oV 3R ltR tRtVtV ;t# )	QDQMatMulc                &   < \         SV `  W4       R # r   r   r   s   &&&r   r   QDQMatMul.__init__   r   r   c                ^   V P                   pVP                  R 8X  g   Q hV P                  '       d   VP                  pM+\        P
                  ! VP                  VP                  4      pV F  p\        W0P                  P                  P                  4       4      '       dm   V P                  P                  V^VP                  R7      w  rEV'       d   V P                  P                  W54       K  V P                  P                  V4       K  V P                  P                  V4       K  	  R# )r;   )default_axisrK   N)r    rK   disable_qdq_for_node_outputr%   	itertoolschainrO   r   r   modelinitializeris_tensor_per_channel"quantize_weight_tensor_per_channelquantize_weight_tensorquantize_activation_tensor)r   r    nodes_to_iteratetensor_nameis_per_channelchannel_axiss   &     r   ri   QDQMatMul.quantize   s    yy||x'''+++#zz(tzz4;;G+KK)=)=)I)I)KLL/3~~/S/Sa 0T 0, "NNEEk`NN99+F99+F ,r   r,   rk   r4   s   @@r   r   r      s     4G Gr   r   )r   r!   rP   r   rt   quant_utilsr   r   r   r   r   base_operatorr	   qdq_base_operatorr
   r   r7   rm   r   r,   r   r   <module>r      s`       & r r , .! .
K*I K*\
R*I R*jG Gr   