code: def build(self):
      self.input_layers = list()
  
      # input layer
  
      for layer in self.model.description.input:
          self.layer_map[layer.name] = CoremlGraphNode(layer)
          self.layer_name_map[layer.name] = layer.name
  
      model_type = self.model.WhichOneof("Type")
      if model_type == "neuralNetworkClassifier":
          # build each layer
          for layer in self.model.neuralNetworkClassifier.layers:
              self.layer_map[layer.name] = CoremlGraphNode(layer)
              self.layer_name_map[layer.name] = layer.name
  
          # if A.output == B.input, then make the connection: A -> B
          for layerA in self.model.neuralNetworkClassifier.layers:
              for layerB in self.model.neuralNetworkClassifier.layers:
                  for A in layerA.output:
                      for B in layerB.input:
                          if A == B:
                              # print('{0:20}->     {1:20}'.format(layerA.name, layerB.name))
                              self._make_connection(
                                  layerA.name, layerB.name
                              )
  
          # if A.name == B.input, then make the connection: A -> B, here A is the input
          for layerA in self.model.description.input:
              for layerB in self.model.neuralNetworkClassifier.layers:
                  for B in layerB.input:
                      if layerA.name == B:
                          self._make_connection(
                              layerA.name, layerB.name
                          )
      elif model_type == "neuralNetwork":
          # build each layer
          for layer in self.model.neuralNetwork.layers:
              self.layer_map[layer.name] = CoremlGraphNode(layer)
              self.layer_name_map[layer.name] = layer.name
  
          # if A.output == B.input, then make the connection: A -> B
          for layerA in self.model.neuralNetwork.layers:
              for layerB in self.model.neuralNetwork.layers:
                  for A in layerA.output:
                      for B in layerB.input:
                          if A == B:
                              # print('{0:20}->     {1:20}'.format(layerA.name, layerB.name))
                              self._make_connection(
                                  layerA.name, layerB.name
                              )
          # if A.name == B.input, then make the connection: A -> B, here A is the input
          for layerA in self.model.description.input:
              for layerB in self.model.neuralNetwork.layers:
                  for B in layerB.input:
                      if layerA.name == B:
                          self._make_connection(
                              layerA.name, layerB.name
                          )
      elif model_type == "neuralNetworkRegressor":
          # build each layer
          for layer in self.model.neuralNetworkRegressor.layers:
              self.layer_map[layer.name] = CoremlGraphNode(layer)
              self.layer_name_map[layer.name] = layer.name
  
          # if A.output == B.input, then make the connection: A -> B
          for layerA in self.model.neuralNetworkRegressor.layers:
              for layerB in self.model.neuralNetworkRegressor.layers:
                  for A in layerA.output:
                      for B in layerB.input:
                          if A == B:
                              # print('{0:20}->     {1:20}'.format(layerA.name, layerB.name))
                              self._make_connection(
                                  layerA.name, layerB.name
                              )
          # if A.name == B.input, then make the connection: A -> B, here A is the input
          for layerA in self.model.description.input:
              for layerB in self.model.neuralNetworkRegressor.layers:
                  for B in layerB.input:
                      if layerA.name == B:
                          self._make_connection(
                              layerA.name, layerB.name
                          )
      else:
          assert False
  
          # The information of the layer
      super(CoremlGraph, self).build()
  
file_path: MMdnn/mmdnn/conversion/coreml/coreml_graph.py
imports: import os
  import coremltools
  from mmdnn.conversion.common.DataStructure.graph import GraphNode, Graph
label_desc: Use image node_id 2 for calling the CoremlGraph obj's underlying member method code with example usage: obj.build() without return types