code: def add_quant_params_to_outputs(
      outputs,
      packed_param_map,
      quant_params,
      input_scales_for_bias,
      keep_quantized_weight=False,
  ):
      """
      Add quant params to outputs so that they can be referenced by other
      ops later. Weights are quantized here.
      """
      for node_name, packed_param_name in packed_param_map.items():
          qparam = quant_params[packed_param_name]
          weight_scale = _get_numpy(qparam.scale)
          param_prefix = packed_param_name[: -len("._packed_params")]
  
          if keep_quantized_weight:
              qparam.weight_var = _expr.var(
                  param_prefix + "_weight",
                  shape=qparam.weight.shape,
                  dtype="int8",
              )
              qparam.weight = quantize_numpy(
                  qparam.weight,
                  weight_scale,
                  _get_numpy(qparam.zero_point),
                  np.int8,
              )
              qweight = qparam.weight_var
          else:
              qparam.weight_var = _expr.var(
                  param_prefix + "_weight",
                  shape=qparam.weight.shape,
                  dtype="float32",
              )
              qweight = relay.qnn.op.quantize(
                  qparam.weight_var,
                  qparam.scale,
                  qparam.zero_point,
                  out_dtype="int8",
                  axis=0,
              )
  
          if qparam.bias is not None:
              float_bias_var = _expr.var(
                  param_prefix + "_bias",
                  shape=qparam.bias.shape,
                  dtype="float32",
              )
              if node_name not in input_scales_for_bias:
                  # This case is for dynamic quantization, where the input activation scale is
                  # unknown until runtime.
                  qparam.bias_var = float_bias_var
                  qbias = qparam.bias_var
              elif keep_quantized_weight:
                  qparam.bias_var = _expr.var(
                      param_prefix + "_bias",
                      shape=qparam.bias.shape,
                      dtype="int32",
                  )
                  qparam.bias = quantize_numpy(
                      qparam.bias,
                      input_scales_for_bias[node_name] * weight_scale,
                      0,
                      np.int32,
                  )
                  qbias = qparam.bias_var
              else:
                  qparam.bias_var = float_bias_var
                  qbias = relay.qnn.op.quantize(
                      qparam.bias_var,
                      _expr.const(
                          input_scales_for_bias[node_name]
                          * weight_scale
                      ),
                      _expr.const(0, "int32"),
                      out_dtype="int32",
                      axis=0,
                  )
          else:
              qbias = None
  
          quant_params[packed_param_name] = qparam
  
          params = [qweight, qparam.scale, qparam.zero_point, qbias]
  
          if isinstance(
              quant_params[packed_param_name], ConvPackedParam
          ):
              params += [
                  qparam.stride,
                  qparam.padding,
                  qparam.dilation,
                  qparam.groups,
                  qparam.output_padding,
              ]
  
          outputs[node_name] = params
  
imports: import numpy
  import tvm
  from tvm import relay
  from tvm.relay import expr
  from tvm.relay import op
  from tvm.relay.frontend.common import infer_shape
  from .common import logger
  from .pytorch_utils import is_version_greater_than
label_desc: Use image node_id 6 for calling a global function with example usage: add_quant_params_to_outputs(outputs, packed_param_map, quant_params, input_scales_for_bias, keep_quantized_weight) without return types