code: def __init__(self, nodes, all_vars):
      self.nodes = []
      self.inputs = []
      self.outputs = []
      self.name = "Paddle Graph"
      output_idx = 0
      for op_node in nodes.values():
          if op_node["type"] == "feed":
              for key, value in op_node["output_vars"].items():
                  self.inputs.append(
                      Parameter(
                          value[0],
                          [
                              Argument(name, all_vars[name])
                              for name in value
                          ],
                      )
                  )
              continue
          if op_node["type"] == "fetch":
              for key, value in op_node["input_vars"].items():
                  self.outputs.append(
                      Parameter(
                          "Output{}".format(output_idx),
                          [
                              Argument(name, all_vars[name])
                              for name in value
                          ],
                      )
                  )
                  output_idx += 1
              continue
          self.nodes.append(Node(op_node, all_vars))
  
      super(Graph, self).__init__(
          name=self.name,
          nodes=self.nodes,
          inputs=self.inputs,
          outputs=self.outputs,
      )
  
imports: from collections import defaultdict
  from collections import deque
label_desc: Use image node_id 1 to create a new Graph object from inherited base classes: dict with example: obj = Graph(nodes, all_vars)