code: def emit_Scale(self, IR_node):
      dims = [
          i.size
          for i in IR_node.layer.attr["_output_shapes"]
          .list.shape[0]
          .dim[1:]
      ]
      units = dims[-1]
      epsilon = 1e-5
      if IR_node.get_attr("scale"):
          self.add_body(
              1,
              "{:15} = _weights_dict['{}']['scale'].squeeze()".format(
                  IR_node.variable_name + "_scale_array", IR_node.name
              ),
          )
      else:
          self.add_body(
              1,
              "{:15} = np.ndarray(_weights_dict['{}']['bias'].shape, dtype=_weights_dict['{}']['bias'].dtype).squeeze()".format(
                  IR_node.variable_name + "_scale_array",
                  IR_node.name,
                  IR_node.name,
              ),
          )
          self.add_body(
              1,
              "{:15}.fill(1)".format(
                  IR_node.variable_name + "_scale_array"
              ),
          )
      self.add_body(
          1,
          "{:15} = helper.make_tensor_value_info('{}', onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], list({}.shape))".format(
              IR_node.variable_name + "_scale",
              IR_node.variable_name + "_scale",
              IR_node.variable_name + "_scale_array",
              IR_node.variable_name + "_scale_array",
          ),
      )
  
      self.add_body(
          1,
          "{:15} = helper.make_tensor(name='{}', data_type=onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], dims={}.shape, vals={})".format(
              IR_node.variable_name + "_scale_init",
              IR_node.variable_name + "_scale",
              IR_node.variable_name + "_scale_array",
              IR_node.variable_name + "_scale_array",
              IR_node.variable_name + "_scale_array",
          ),
      )
      self.add_body(
          1,
          "{:15} = _weights_dict['{}']['bias'].squeeze()".format(
              IR_node.variable_name + "_bias_array", IR_node.name
          ),
      )
      self.add_body(
          1,
          "{:15} = helper.make_tensor_value_info('{}', onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], list({}.shape))".format(
              IR_node.variable_name + "_bias",
              IR_node.variable_name + "_bias",
              IR_node.variable_name + "_bias_array",
              IR_node.variable_name + "_bias_array",
          ),
      )
  
      self.add_body(
          1,
          "{:15} = helper.make_tensor(name='{}', data_type=onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], dims={}.shape, vals={}.flatten().astype(float))".format(
              IR_node.variable_name + "_bias_init",
              IR_node.variable_name + "_bias",
              IR_node.variable_name + "_bias_array",
              IR_node.variable_name + "_bias_array",
              IR_node.variable_name + "_bias_array",
          ),
      )
      self.add_body(
          1,
          "{:15} = np.zeros({}, dtype=np.float32)".format(
              IR_node.variable_name + "_mean_array", units
          ),
      )
      self.add_body(
          1,
          "{:15} = helper.make_tensor_value_info('{}', onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], list({}.shape))".format(
              IR_node.variable_name + "_mean",
              IR_node.variable_name + "_mean",
              IR_node.variable_name + "_mean_array",
              IR_node.variable_name + "_mean_array",
          ),
      )
  
      self.add_body(
          1,
          "{:15} = helper.make_tensor(name='{}', data_type=onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], dims={}.shape, vals={}.flatten().astype(float))".format(
              IR_node.variable_name + "_mean_init",
              IR_node.variable_name + "_mean",
              IR_node.variable_name + "_mean_array",
              IR_node.variable_name + "_mean_array",
              IR_node.variable_name + "_mean_array",
          ),
      )
      self.add_body(
          1,
          "{:15} = np.ones({}, dtype=np.float32)".format(
              IR_node.variable_name + "_var_array", units
          ),
      )
      self.add_body(
          1,
          "{:15} = helper.make_tensor_value_info('{}', onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], list({}.shape))".format(
              IR_node.variable_name + "_var",
              IR_node.variable_name + "_var",
              IR_node.variable_name + "_var_array",
              IR_node.variable_name + "_var_array",
          ),
      )
  
      self.add_body(
          1,
          "{:15} = helper.make_tensor(name='{}', data_type=onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[{}.dtype], dims={}.shape, vals={}.flatten().astype(float))".format(
              IR_node.variable_name + "_var_init",
              IR_node.variable_name + "_var",
              IR_node.variable_name + "_var_array",
              IR_node.variable_name + "_var_array",
              IR_node.variable_name + "_var_array",
          ),
      )
      self.add_body(
          1,
          "{:15} = helper.make_node('BatchNormalization', inputs=['{}', '{}', '{}', '{}', '{}'],outputs=['{}'], epsilon={}, is_test={}, name='{}')".format(
              IR_node.variable_name,
              self.parent_variable_name(IR_node),
              IR_node.variable_name + "_scale",
              IR_node.variable_name + "_bias",
              IR_node.variable_name + "_mean",
              IR_node.variable_name + "_var",
              IR_node.variable_name,
              epsilon,
              0 if self.phase == "train" else 1,
              IR_node.variable_name,
          ),
      )
      self.inputs.append(IR_node.variable_name + "_scale")
      self.inputs.append(IR_node.variable_name + "_bias")
      self.inputs.append(IR_node.variable_name + "_mean")
      self.inputs.append(IR_node.variable_name + "_var")
      self.initializer.append(IR_node.variable_name + "_scale_init")
      self.initializer.append(IR_node.variable_name + "_bias_init")
      self.initializer.append(IR_node.variable_name + "_mean_init")
      self.initializer.append(IR_node.variable_name + "_var_init")
      self.nodes.append(IR_node.variable_name)
  
imports: from mmdnn.conversion.common.DataStructure.emitter import Emitter
  from mmdnn.conversion.common.IR.IR_graph import IRGraph
  import os.path
  import mmdnn.conversion.common.IR.graph_pb2
  import numpy
  import sys
label_desc: Use image node_id 10 for calling the OnnxEmitter obj's underlying member method code with example usage: obj.emit_Scale(IR_node) without return types