code: def quantize_parameter(self):
      # Quantize parameters
      for op in self.models["subgraphs"][0]["operators"]:
          opcode_index = op.get("opcode_index", 0)
          op_name = self.models["operator_codes"][opcode_index][
              "builtin_code"
          ]
          inputs = op["inputs"]
          requirements = QUANTIZATIONREQUIREMENTS[op_name]
          for input_idx in range(len(inputs)):
              tensor_idx = inputs[input_idx]
              tensor_type = self.get_tensor_type_by_index(tensor_idx)
              input_idx = "Input_{}".format(input_idx)
              requirement = requirements.get(input_idx)
              if not requirement:
                  continue
              if requirements.get("op_version") is not None:
                  self.models["operator_codes"][opcode_index][
                      "version"
                  ] = requirements.get("op_version")
              if tensor_type == "Buffer":
                  continue
              vrange = requirement["range"]
              data, tensor = self.get_tensor_and_data_by_index(
                  tensor_idx
              )
              dtype = DTYPES.get(tensor["type"], np.float32)
              (
                  min_value,
                  max_value,
                  quantized_dimension,
              ) = self.calculate_min_max(data, requirement)
              scale, zero_point = self.calculate_scale_and_zero_point(
                  inputs,
                  data,
                  min_value,
                  max_value,
                  requirement,
                  vrange,
              )
              # quantize float32 parameter to int8
              scale += 1e-38
              data = np.round(data / scale + zero_point)
              if requirement["data_type"] == "int8":
                  data = data.astype(np.int8).flatten().tobytes()
              if requirement["data_type"] == "int32":
                  data = data.astype(np.int32).flatten().tobytes()
              data = [data[i] for i in range(len(data))]
              self.set_tensor_data_by_index(tensor_idx, data)
              tensor["type"] = requirement["data_type"].upper()
              tensor["quantization"] = {
                  "min": np.around(min_value, 6)
                  .astype(dtype)
                  .flatten()
                  .tolist(),
                  "max": np.around(max_value, 6)
                  .astype(dtype)
                  .flatten()
                  .tolist(),
                  "scale": np.around(scale, 6)
                  .astype(dtype)
                  .flatten()
                  .tolist(),
                  "zero_point": zero_point.astype(np.int32)
                  .flatten()
                  .tolist(),
              }
              if quantized_dimension is not None:
                  tensor["quantization"][
                      "quantized_dimension"
                  ] = quantized_dimension
  
imports: import numpy
  import tensorflow
  import tqdm
label_desc: Use image node_id 10 for calling the QuantizationConverter obj's underlying member method code with example usage: obj.quantize_parameter() without return types