code: def parse(graph, args=None, omit_useless_nodes=True):
      """This method parses an optimized PyTorch model graph and produces
      a list of nodes and node stats for eventual conversion to TensorBoard
      protobuf format.
      Args:
        graph (PyTorch module): The model to be parsed.
        args (tuple): input tensor[s] for the model.
        omit_useless_nodes (boolean): Whether to remove nodes from the graph.
      """
      n_inputs = len(args)
  
      scope = {}
      nodes_py = GraphPy()
      for i, node in enumerate(graph.inputs()):
          if omit_useless_nodes:
              if (
                  len(node.uses()) == 0
              ):  # number of user of the node (= number of outputs/ fanout)
                  continue
  
          if i < n_inputs:
              nodes_py.append(NodePyIO(node, "input"))
          else:
              nodes_py.append(NodePyIO(node))  # parameter
  
      for node in graph.nodes():
          nodes_py.append(NodePyOP(node))
  
      for node in graph.outputs():  # must place last.
          NodePyIO(node, "output")
      nodes_py.find_common_root()
      nodes_py.populate_namespace_from_OP_to_IO()
      return nodes_py
  
imports: from torch.utils.tensorboard._pytorch_graph import GraphPy, NodePyIO, NodePyOP
  import torch
  from .None import transforms
  from collections import abc
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: parse(graph, args, omit_useless_nodes) and returns: nodes_py