code: def __init__(
      self,
      nodes,  # type: List[Node]
      inputs,  # type: List[EdgeInfo]
      outputs,  # type: List[EdgeInfo]
      shape_dict,  # type: Dict[Text,Tuple[int,...]]
  ):
      # type: (...) -> None
      self.nodes = nodes
      self.inputs = inputs
      self.outputs = outputs
      self.shape_dict = shape_dict  # data blob name to its shape
  
      # data blob name to the list of op types it feeds into
      self.blob_to_op_type = {}  # type: Dict[Text, List[Text]]
      # data blob name to the op_type that generates it
      self.blob_from_op_type = {}  # type: Dict[Text, Text]
  
      for node_ in nodes:
          for input_ in node_.inputs:
              if input_ in self.blob_to_op_type:
                  self.blob_to_op_type[input_].append(node_.op_type)
              else:
                  self.blob_to_op_type[input_] = [node_.op_type]
          for output_ in node_.outputs:
              if output_ in self.blob_from_op_type:
                  raise ValueError(
                      "Data blob: %s, is generated by more than 1 op"
                      % (output_)
                  )
              self.blob_from_op_type[output_] = node_.op_type
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from onnx import numpy_helper, ValueInfoProto, AttributeProto, GraphProto, NodeProto, TensorProto, TensorShapeProto
  from typing import Any, Text, Iterable, List, Dict, Sequence, Optional, Tuple, Union
  from typing_extensions import Protocol
  import numpy
label_desc: Use image node_id 1 to create a new Graph object from inherited base classes: object with example: obj = Graph(nodes, inputs, outputs, shape_dict)