
    fPiD                           G d  d          Z dS )c                        e Zd Zd Zd Zd ZdS )QuantOperatorBasec                 "    || _         || _        d S )N)	quantizernode)selfonnx_quantizer	onnx_nodes      /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/onnxruntime/quantization/operators/base_operator.py__init__zQuantOperatorBase.__init__   s    '			    c                     | j                             | j                  sdS | j                             | j        j        d                   S )NF    )r   should_quantize_noder   is_float_tensorinput)r   s    r
   should_quantizez!QuantOperatorBase.should_quantize   s@    ~2249== 	5~--dioa.@AAAr   c                    t          | j        j                  D ]@\  }}| j                            |          }|| j        j                            |           A| j        j                            | j                   dS )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   s}     'ty77 	A 	AMAz"n>>zJJO*(//@@@ 	 ''	22222r   N)__name__
__module____qualname__r   r   r    r   r
   r   r      sD          B B B3 3 3 3 3r   r   N)r   r   r   r
   <module>r       s7   3 3 3 3 3 3 3 3 3 3r   