code: def load_graph(self, graph_proto):
      if not graph_proto:
          invalidInputError(False, "Graph proto is required")
  
      input_nodes = list()
      output_nodes = list()
      tensor_map = dict()
      initialized_tensors = set()
      module_map = dict()
      root_nodes = list()
      dummy_root = Identity()()
  
      for tensor in graph_proto.initializer:
          if not tensor.name.strip():
              invalidInputError(False, "Tensor's name is required")
          initialized_tensors.add(tensor.name)
          tensor_data = parse_tensor_data(tensor)
          tensor_map[tensor.name] = (tensor_data, tensor_data.shape)
  
      for gin in graph_proto.input:
          if gin.name not in initialized_tensors:
              input_nodes.append(gin.name)
              shape = tuple(
                  [
                      dim.dim_value
                      for dim in gin.type.tensor_type.shape.dim
                  ]
              )
              module_map[gin.name] = Identity()(dummy_root)
              tensor_map[gin.name] = (None, shape)
  
      for gout in graph_proto.output:
          if gout.name not in initialized_tensors:
              output_nodes.append(gout.name)
  
      for node in graph_proto.node:
          name = node.name.strip()
          op_type = node.op_type
          inputs = [tensor_map[n] for n in node.input]
          outputs = node.output
          prev_modules = [
              module_map[n]
              for n in node.input
              if n not in initialized_tensors
          ]
          attrs = parse_node_attr(node)
  
          if len(prev_modules) == 0:
              root_nodes.append((name, op_type))
              prev_modules = [dummy_root]
  
          (
              bigdl_module,
              outputs_shape,
          ) = self._make_module_from_onnx_node(
              op_type, inputs, prev_modules, attrs, outputs
          )
  
          invalidInputError(
              len(outputs) == len(outputs_shape),
              f"size of outputs {len(outputs)} doesn't match outputs_shape"
              f" ${len(outputs_shape)}",
          )
  
          for out, out_shape in zip(outputs, outputs_shape):
              module_map[out] = bigdl_module
              tensor_map[out] = (None, out_shape)
  
      in_modules = [module_map[m] for m in input_nodes]
      out_modules = [module_map[m] for m in output_nodes]
      model = Model([dummy_root], out_modules)
  
      return model
  
file_path: BigDL/python/dllib/src/bigdl/dllib/contrib/onnx/onnx_loader.py
imports: from bigdl.dllib.nn.layer import Identity, Model
  from .ops_mapping import _convert_map
  from .converter_utils import parse_node_attr, parse_tensor_data
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 2 for calling the OnnxLoader obj's underlying member method code with example usage: obj.load_graph(graph_proto) and returns: model