code: def emit_Conv(self, IR_node):
      kernel_shape = list(IR_node.get_attr("kernel_shape"))[:-2]
      dilations = list(
          IR_node.get_attr("dilations", [1] * (len(kernel_shape) + 2))
      )[1:-1]
      group = IR_node.get_attr("group", 1)
      if IR_node.type == "DepthwiseConv":
          group = IR_node.IR_layer.attr["kernel_shape"].list.i[-2]
          self.weights_dict[IR_node.name]["weights"] = np.swapaxes(
              self.weights_dict[IR_node.name]["weights"], -1, -2
          )
      pads = IR_node.get_attr("pads")
      pad_length = len(pads)
      pads = (
          pads[1 : pad_length // 2 - 1]
          + pads[pad_length // 2 + 1 : pad_length - 1]
      )
      strides = list(IR_node.get_attr("strides"))[1:-1]
      use_bias = IR_node.get_attr("use_bias")
      self.add_body(
          1,
          "{:15} = _weights_dict['{}']['weights']".format(
              IR_node.variable_name + "_weight_array", IR_node.name
          ),
      )
      self.add_body(
          1,
          "{} = {}.transpose([3,2,0,1])".format(
              IR_node.variable_name + "_weight_array",
              IR_node.variable_name + "_weight_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 + "_weight",
              IR_node.variable_name + "_weight",
              IR_node.variable_name + "_weight_array",
              IR_node.variable_name + "_weight_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 + "_weight_init",
              IR_node.variable_name + "_weight",
              IR_node.variable_name + "_weight_array",
              IR_node.variable_name + "_weight_array",
              IR_node.variable_name + "_weight_array",
          ),
      )
  
      if use_bias:
          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} = helper.make_node('Conv', inputs=['{}', '{}', '{}'],outputs=['{}'], dilations={}, group={}, kernel_shape={}, pads={}, strides={}, name='{}')".format(
                  IR_node.variable_name,
                  self.parent_variable_name(IR_node),
                  IR_node.variable_name + "_weight",
                  IR_node.variable_name + "_bias",
                  IR_node.variable_name,
                  dilations,
                  group,
                  kernel_shape,
                  pads,
                  strides,
                  IR_node.variable_name,
              ),
          )
          # self.nodes.append(IR_node.variable_name + '_bias')
          self.initializer.append(IR_node.variable_name + "_bias_init")
          self.inputs.append(IR_node.variable_name + "_bias")
      else:
          self.add_body(
              1,
              "{:15} = helper.make_node('Conv', inputs=['{}', '{}'], outputs=['{}'], dilations={}, group={}, kernel_shape={}, pads={}, strides={}, name='{}')".format(
                  IR_node.variable_name,
                  self.parent_variable_name(IR_node),
                  IR_node.variable_name + "_weight",
                  IR_node.variable_name,
                  dilations,
                  group,
                  kernel_shape,
                  pads,
                  strides,
                  IR_node.variable_name,
              ),
          )
      # self.nodes.append(IR_node.variable_name + '_weight')
      self.initializer.append(IR_node.variable_name + "_weight_init")
      self.inputs.append(IR_node.variable_name + "_weight")
      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 8 for calling the OnnxEmitter obj's underlying member method code with example usage: obj.emit_Conv(IR_node) without return types