parameters: (self, node, input_index, qType, given_scale_name=None, given_zp_name=None)
return_statement: return nodes + [qlinear_node]
docstring: Given an input for a node (which is not a initializer), this function
  
          - add nodes to compute zero point and scale for this input if they don't exist.
          - add new QuantizeLinear node to quantize the input.
  
          :param node: node being quantized in NodeProto format.
          :param input_index: index of input in node.input.
          :param qType: type to quantize to.
          :param given_scale_name: if those inputs need to be quanitzed using this scale tensor.
          :param given_zp_name: if those inputs to be quantized using this zeropoint tensor.
          :return: List of newly created nodes in NodeProto format.
docstring_summary: Given an input for a node (which is not a initializer), this function
docstring_tokens: Given an input for a node ( which is not a initializer ) this function
function: def _get_quantize_input_nodes(self, node, input_index, qType, given_scale_name=None, given_zp_name=None):
          '''
          Given an input for a node (which is not a initializer), this function
  
          - add nodes to compute zero point and scale for this input if they don't exist.
          - add new QuantizeLinear node to quantize the input.
  
          :param node: node being quantized in NodeProto format.
          :param input_index: index of input in node.input.
          :param qType: type to quantize to.
          :param given_scale_name: if those inputs need to be quanitzed using this scale tensor.
          :param given_zp_name: if those inputs to be quantized using this zeropoint tensor.
          :return: List of newly created nodes in NodeProto format.
          '''
          input_name = node.input[input_index]
          output_name = input_name + "_quantized"
          ql_node_name = input_name + "_QuantizeLinear"
  
          if (given_scale_name is not None) and (given_zp_name is not None):
              data_found, scale_name, zp_name = (True, given_scale_name, given_zp_name)
          else:
              data_found, scale_name, zp_name, _, _ = self._get_quantization_params(input_name)
  
          nodes = []
          if data_found == True:
              qlinear_node = onnx.helper.make_node("QuantizeLinear", [input_name, scale_name, zp_name],
                                                   [output_name], ql_node_name)
          else:
              if self.static:
                  return None
              # dynamic mode
              # Scale and Zero Points not available for this input. Add nodes to dynamically compute it
              if self.fuse_dynamic_quant and qType == onnx_proto.TensorProto.UINT8:
                  scale_name = input_name + "_scale"
                  zp_name = input_name + "_zero_point"
                  qlinear_node = onnx.helper.make_node("DynamicQuantizeLinear", [input_name],
                                                       [output_name, scale_name, zp_name], ql_node_name)
              else:
                  scale_name, zp_name, scale_shape, zp_shape = \
                      self._get_dynamic_input_quantization_params(input_name, nodes, qType)
                  qlinear_node = onnx.helper.make_node("QuantizeLinear", [input_name, scale_name, zp_name],
                                                       [output_name], ql_node_name)
  
          self.quantized_value_map[input_name] = QuantizedValue(input_name, output_name, scale_name, zp_name, qType)
          return nodes + [qlinear_node]
function_tokens: def _get_quantize_input_nodes ( self , node , input_index , qType , given_scale_name = None , given_zp_name = None ) : input_name = node . input [ input_index ] output_name = input_name + "_quantized" ql_node_name = input_name + "_QuantizeLinear" if ( given_scale_name is not None ) and ( given_zp_name is not None ) : data_found , scale_name , zp_name = ( True , given_scale_name , given_zp_name ) else : data_found , scale_name , zp_name , _ , _ = self . _get_quantization_params ( input_name ) nodes = [ ] if data_found == True : qlinear_node = onnx . helper . make_node ( "QuantizeLinear" , [ input_name , scale_name , zp_name ] , [ output_name ] , ql_node_name ) else : if self . static : return None # dynamic mode # Scale and Zero Points not available for this input. Add nodes to dynamically compute it if self . fuse_dynamic_quant and qType == onnx_proto . TensorProto . UINT8 : scale_name = input_name + "_scale" zp_name = input_name + "_zero_point" qlinear_node = onnx . helper . make_node ( "DynamicQuantizeLinear" , [ input_name ] , [ output_name , scale_name , zp_name ] , ql_node_name ) else : scale_name , zp_name , scale_shape , zp_shape = self . _get_dynamic_input_quantization_params ( input_name , nodes , qType ) qlinear_node = onnx . helper . make_node ( "QuantizeLinear" , [ input_name , scale_name , zp_name ] , [ output_name ] , ql_node_name ) self . quantized_value_map [ input_name ] = QuantizedValue ( input_name , output_name , scale_name , zp_name , qType ) return nodes + [ qlinear_node ]