class_docstr: This class is created to make sure PackedParams
  (e.g. LinearPackedParams, Conv2dPackedParams) to appear in state_dict
  so that we can serialize and deserialize quantized graph module with
  torch.save(m.state_dict()) and m.load_state_dict(state_dict)
class_docstr_tok: ["This","class","is","created","to","make","sure","PackedParams","(","e.g",".","LinearPackedParams",",","Conv2dPackedParams",")","to","appear","in","state_dict","so","that","we","can","serialize","and","deserialize","quantized","graph","module","with","torch.save","(","m.state_dict","(",")",")","and","m.load_state_dict","(","state_dict",")"]
code: def __init__(
      self,
      root: Union[torch.nn.Module, Dict[str, Any]],
      graph: Graph,
      preserved_attr_names: Set[str],
  ):
      self.preserved_attr_names = preserved_attr_names
      preserved_attrs = {
          attr: getattr(root, attr)
          for attr in self.preserved_attr_names
          if hasattr(root, attr)
      }
      super().__init__(root, graph)
      for attr in preserved_attrs:
          setattr(self, attr, preserved_attrs[attr])
      self._register_state_dict_hook(_save_packed_weight)
  
imports: import torch
  import copy
  from torch.fx import GraphModule
  from torch.fx.graph import Graph
  from typing import Union, Dict, Any, Set
label_desc: Use image node_id 1 to create a new QuantizedGraphModule object from inherited base classes: GraphModule with example: obj = QuantizedGraphModule(root, graph, preserved_attr_names)