code: def rename_InputLayer(self, source_node):
      # only for training
      IR_node = self.IR_graph.node.add()
  
      # name, op
      IR_node.name = source_node.name
      IR_node.op = "DataInput"
      graph_shape = graph_pb2.TensorShape()
      coreml_node_layer = source_node.layer
  
      new_dim = graph_shape.dim.add()
      new_dim.size = -1
      new_dim = graph_shape.dim.add()
      new_dim.size = coreml_node_layer.type.imageType.width
      new_dim = graph_shape.dim.add()
      new_dim.size = coreml_node_layer.type.imageType.height
      new_dim = graph_shape.dim.add()
  
      if coreml_node_layer.type.imageType.colorSpace == 10:
          new_dim.size = 2
      elif coreml_node_layer.type.imageType.colorSpace == 20:
          new_dim.size = 3
      elif coreml_node_layer.type.imageType.colorSpace == 30:
          new_dim.size = 3
      else:
          assert False
      IR_node.attr["_output_shapes"].list.shape.extend([graph_shape])
  
      # input edge
      self.convert_inedge(source_node, IR_node)
  
      # shape
      # NHWC channel last
      # in fact, here is NWHC
      new_dim = IR_node.attr["shape"].shape.dim.add()
      new_dim.size = -1
      new_dim = IR_node.attr["shape"].shape.dim.add()
      new_dim.size = coreml_node_layer.type.imageType.width
      new_dim = IR_node.attr["shape"].shape.dim.add()
      new_dim.size = coreml_node_layer.type.imageType.height
      new_dim = IR_node.attr["shape"].shape.dim.add()
  
      if coreml_node_layer.type.imageType.colorSpace == 10:
          new_dim.size = 2
      elif coreml_node_layer.type.imageType.colorSpace == 20:
          new_dim.size = 3
      elif coreml_node_layer.type.imageType.colorSpace == 30:
          new_dim.size = 3
      else:
          assert False
  
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 18 for calling the CoremlParser obj's underlying member method code with example usage: obj.rename_InputLayer(source_node) without return types