class_docstr: Partition class contains all the information about an individual partition.
  It also provides necessary methods for manipulation the partition.
class_docstr_tok: ["Partition","class","contains","all","the","information","about","an","individual","partition",".","It","also","provides","necessary","methods","for","manipulation","the","partition","."]
code: def add_node(self, node):
      input_nodes: Dict[Node, None] = {}
      map_arg(node.args, input_nodes.setdefault)
      map_arg(node.kwargs, input_nodes.setdefault)
      # Add current node's input nodes if they are placeholder or constants
      for n in input_nodes:
          if n.op in {"placeholder", "get_attr"}:
              self.nodes.add(n)
      self.nodes.add(node)
      self.recalculate_mem_size()
  
imports: from enum import Enum
  from typing import NamedTuple, Dict, List, Set
  from torch.fx.node import Node, map_arg
label_desc: Use image node_id 4 for calling the Partition obj's underlying member method code with example usage: obj.add_node(node) without return types