code: def _build_graph(self):
      op_dict = {}
      for node in self.graph_def.node:
          op_dict[node.name] = Operator(node)
  
      for node in self.graph_def.node:
          if node.op == "Const":
              del op_dict[node.name].node.input[:]
              continue
          for inp in node.input:
              inp = self._strip_node_name(inp)
              if inp not in op_dict:
                  raise ValueError(
                      "{} has unresolved input:{}.".format(node.op, inp)
                  )
              else:
                  op_dict[inp].refcount += 1
                  op_dict[node.name].inputs.append(op_dict[inp])
                  op_dict[inp].outputs.append(op_dict[node.name])
  
      inputs = set(
          filter(
              lambda op: len(op.inputs) == 0,
              [op for op in op_dict.values()],
          )
      )
      outputs = set(
          filter(
              lambda op: len(op.outputs) == 0,
              [op for op in op_dict.values()],
          )
      )
  
      dead_ops = inputs & outputs
      inputs -= dead_ops
      outputs -= dead_ops
  
      for op in dead_ops:
          del op_dict[op.node.name]
  
      self.net_inputs = inputs
      self.net_outputs = outputs
      self.op_dict = op_dict
  
imports: import numpy
  import tensorflow.compat.v1
  from tensorflow.core.framework.tensor_pb2 import TensorProto
  from tensorflow.core.framework.tensor_shape_pb2 import TensorShapeProto
label_desc: Use image node_id 7 for calling the RefineGraph obj's underlying member method code with example usage: obj._build_graph() without return types