code: def extractgraph(self, dummy_input):
      import re
      from torch.onnx.utils import OperatorExportTypes
      from torch.onnx.utils import _trace
  
      self.model.eval()
      with scope_name_workaround():
          graph = _trace(
              self.model, dummy_input, OperatorExportTypes.ONNX
          )
      nodes = list(graph.nodes())
  
      for node in nodes:
          # print(node.__str__())
          node_id = PytorchGraph.get_node_id(node)
          node_name = "node" + node_id
          self.layer_weight_map[node_name] = ".".join(
              re.findall(r"\[([\w\d.]+)\]", node.scopeName())
          )
      return graph, nodes
  
imports: from mmdnn.conversion.common.DataStructure.graph import GraphNode, Graph
  import torch
  import torch.autograd
  import torch.serialization
  import contextlib
  from torch.jit import _unique_state_dict
label_desc: Use image node_id 2 for calling the PytorchGraph151 obj's underlying member method code with example usage: obj.extractgraph(dummy_input) and returns: graph,  nodes