code: def __convert_convolution(self, source_node, dim):
      IR_node = self.IR_graph.node.add()
      # input edge
      self.convert_inedge(source_node, IR_node)
      source_node_layer = source_node.layer
      source_node_conv = source_node_layer.convolution
      layer_name = source_node_layer.name.split("/")[-1]
  
      # important!
      if source_node_conv.HasField("weights"):
          # reshape the weight!
          [h, w, k, o] = list(source_node_conv.kernelSize) + [
              source_node_conv.kernelChannels,
              source_node_conv.outputChannels,
          ]
          # [2, 3, 0, 1]
          weights = (
              np.array(
                  source_node_conv.weights.floatValue, dtype=np.float32
              )
              .reshape([o, k, h, w])
              .transpose([2, 3, 1, 0])
          )
  
      kwargs = dict()
      kwargs["kernel_shape"] = list(source_node_conv.kernelSize) + [
          source_node_conv.kernelChannels,
          source_node_conv.outputChannels,
      ]
  
      # pads
      CoremlParser._convert_padding(source_node, IR_node)
      # use_bias
      kwargs["use_bias"] = source_node_conv.hasBias
      # isDeconvolution
      kwargs["isDeconvolution"] = source_node_conv.isDeconvolution
      # name, op
      if layer_name == "sep":
          CoremlParser._copy_and_reop(source_node, IR_node, "Conv")
      elif layer_name == "dw":
          CoremlParser._copy_and_reop(
              source_node, IR_node, "DepthwiseConv"
          )
          weights = weights.transpose((0, 1, 3, 2))
          kwargs["kernel_shape"] = list(source_node_conv.kernelSize) + [
              source_node_conv.outputChannels,
              source_node_conv.kernelChannels,
          ]
  
      else:
          if kwargs["isDeconvolution"]:
              CoremlParser._copy_and_reop(
                  source_node, IR_node, "ConvTranspose"
              )
          else:
              CoremlParser._copy_and_reop(source_node, IR_node, "Conv")
  
      self.set_weight(source_node.name, "weights", weights)
      if source_node_layer.convolution.HasField("bias"):
          self.set_weight(
              source_node.name,
              "bias",
              np.array(
                  source_node_conv.bias.floatValue, dtype=np.float32
              ),
          )
  
      # kwargs['kernel_shape'] = weights.shape
  
      kwargs["group"] = source_node_conv.nGroups
  
      # strides
      # [1, sd, sh, sw, 1]
      kwargs["strides"] = [1] + list(source_node_conv.stride) + [1]
  
      dilation = list(source_node_conv.dilationFactor)
      if dilation == []:
          dilation = [1, 1]
      kwargs["dilations"] = [1] + dilation + [1]
  
      assign_IRnode_values(IR_node, kwargs)
  
      # activation
      # TODO
      self._defuse_activation(source_node)
  
imports: import os
  from six import string_types
  import numpy
  import math
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models import datatypes
  from coremltools.models import MLModel
  from coremltools.models.utils import save_spec
  from coremltools.models._infer_shapes_nn_mlmodel import infer_shapes
  from coremltools.proto import Model_pb2, NeuralNetwork_pb2
  from mmdnn.conversion.coreml.coreml_graph import CoremlGraph
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
  from mmdnn.conversion.common.DataStructure.parser import Parser
  from mmdnn.conversion.common.utils import *
label_desc: Use image node_id 9 for calling the CoremlParser obj's underlying member method code with example usage: obj.__convert_convolution(source_node, dim) without return types