code: def build(self):
      graph = micro_mem_pb2.Graph()
      graph.output_infos.extend(self.output_infos)
      for idx, op_def in enumerate(self.net_def.op):
          op_context = graph.op_contexts.add()
          mace_check(idx >= 0, "Error from the OpResolver.")
          op_context.op_idx = idx
  
          op_with_model_input = False
          for input in op_def.input:
              input_info = 0
              if input in self.output_cache:
                  input_info = self.output_cache[input]
              elif input in self.const_tensor_cache:
                  input_info = self.const_tensor_cache[input]
              elif input in self.model_input_cache:
                  input_info = self.model_input_cache[input]
                  op_with_model_input = True
              else:
                  mace_check(
                      False,
                      "Model error: can not find input(%s)" % input,
                  )
              op_context.input_infos.append(input_info)
          if op_with_model_input:
              graph.input_op_idxs.append(idx)
  
          for output_shape in op_def.output_shape:
              resize_shape = op_context.output_resize_shapes.add()
              for dim in output_shape.dims:
                  resize_shape.dims.append(dim)
      return graph
  
file_path: mace/tools/python/micro/graph_builder.py
imports: from py_proto import micro_mem_pb2
  from utils.util import mace_check
label_desc: Use image node_id 5 for calling the GraphBuilder obj's underlying member method code with example usage: obj.build() and returns: graph