
    gD                          G d  d      Z y)c                       e Zd Zd Zd Zd Zy)QuantOperatorBasec                      || _         || _        y )N)	quantizernode)selfonnx_quantizer	onnx_nodes      e/var/www/openai/venv/lib/python3.12/site-packages/onnxruntime/quantization/operators/base_operator.py__init__zQuantOperatorBase.__init__   s    '	    c                     | j                   j                  | j                        sy| j                   j                  | j                  j                  d         S )NF    )r   should_quantize_noder   is_float_tensorinput)r   s    r
   should_quantizez!QuantOperatorBase.should_quantize   s=    ~~22499=~~--diiooa.@AAr   c                 6   t        | j                  j                        D ]H  \  }}| j                  j	                  |      }|$| j                  j
                  j                  |       J | j                  j
                  j                  | j                         y)a  
        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
   quantizezQuantOperatorBase.quantize   so     'tyy7MAz"nn>>zJO*((//@ 8 	  ''		2r   N)__name__
__module____qualname__r   r   r    r   r
   r   r      s    B3r   r   N)r   r   r   r
   <module>r       s   3 3r   