code: def _add_output_quant_params_to_scalar_op(
      node, graph, input_scale, input_zero_point, scalar
  ):
      """
      The output scale and zp of {add,mul}_scalar op are not explicit in the IR
      They are required for _get_quant_param_for_input above to work correctly
      So calculate these params using the same way torch does, and make new
      constant nodes in the input IR. Also add these params to the inputs of
      scalar op.
  
      For example,
         %6 : float = prim::Constant[value=3.]()
         %input : QUInt8(1, 3, 224, 224) = quantized::add_scalar(%x.1, %6)
      becomes
         %6 : float = prim::Constant[value=3.]()
         %7 : float = prim::Constant[value=0.015686161816120148]()
         %8 : int = prim::Constant[value=0]()
         %input : UInt8(1, 3, 224, 224) = quantized::add_scalar(%x.1, %6, %7, %8)
  
      %7 and %8 are newly created output scale and zp constant nodes
      """
      # pylint: disable=c-extension-no-member
      import torch
  
      operator = node.kind()
  
      if operator == "quantized::mul_scalar":
          (
              out_scale,
              out_zero_point,
          ) = _get_mul_scalar_output_quant_param(
              input_scale, input_zero_point, scalar
          )
      elif operator == "quantized::add_scalar":
          (
              out_scale,
              out_zero_point,
          ) = _get_add_scalar_output_quant_param(
              input_scale, input_zero_point, scalar
          )
      else:
          raise NotImplementedError(
              f"unsupported scalar op: {operator}"
          )
  
      # create new constant nodes and add them to graph
      out_scale_node = graph.create("prim::Constant")
      out_zero_point_node = graph.create("prim::Constant")
      out_scale_node.insertBefore(node)
      out_zero_point_node.insertBefore(node)
      out_scale_node.f_("value", out_scale)
      out_zero_point_node.i_("value", out_zero_point)
      out_scale_node.output().setType(torch._C.FloatType.get())
      out_zero_point_node.output().setType(torch._C.IntType.get())
      node.addInput(out_scale_node.output())
      node.addInput(out_zero_point_node.output())
  
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 10 for calling a global function with example usage: _add_output_quant_params_to_scalar_op(node, graph, input_scale, input_zero_point, scalar) without return types