
    hD                          " S  S5      r g)c                   &    \ rS rSrS rS rS rSrg)QuantOperatorBase   c                     Xl         X l        g )N)	quantizernode)selfonnx_quantizer	onnx_nodes      j/var/www/fran/franai/venv/lib/python3.13/site-packages/onnxruntime/quantization/operators/base_operator.py__init__QuantOperatorBase.__init__   s    '	    c                     U R                   R                  U R                  5      (       d  gU R                   R                  U R                  R                  S   5      $ )NF    )r   should_quantize_noder   is_float_tensorinput)r   s    r   should_quantize!QuantOperatorBase.should_quantize   s@    ~~22499==~~--diiooa.@AAr   c                 <   [        U R                  R                  5       HJ  u  pU R                  R	                  U5      nUc  M%  U R                  R
                  R                  U5        ML     U R                  R
                  R                  U R                  5        g)aW  
Given a node which does not support quantization, this method checks whether the input to
this node is quantized and adds a DequantizeLinear node to dequantize this input back to FP32
    parameter node: Current node
    parameter new_nodes_list: List of new nodes created before processing current node
    return: List of new nodes created
N)	enumerater   r   r   _dequantize_value	new_nodesappend)r   _
node_inputdequantize_nodes       r   quantizeQuantOperatorBase.quantize   sm     'tyy7MA"nn>>zJO*((//@ 8 	  ''		2r   )r   r   N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__ r   r   r   r      s    B3r   r   N)r   r%   r   r   <module>r&      s   3 3r   