class_docstr: Generates model graph, each node is created from single or multiple jit trace nodes.
class_docstr_tok: ["Generates","model","graph",",","each","node","is","created","from","single","or","multiple","jit","trace","nodes","."]
docstr: Extract linear shape input/output tensor shape info from its aten::addmm op.
  
  Parameters
  ----------
  node_group : NodePyGroup
      NodePyGroup object associated with the linear module.
  
  Returns
  -------
  dict
      Include shape of input tensor and shape of output tensor
docstr_tok: ["Extract","linear","shape","input\/output","tensor","shape","info","from","its","aten",":",":addmm","op",".","Parameters","--","--","--","--","--","node_group",":","NodePyGroup","NodePyGroup","object","associated","with","the","linear","module",".","Returns","--","--","--","-","dict","Include","shape","of","input","tensor","and","shape","of","output","tensor"]
code: def _extract_linear_shape_info(self, node_group):
      """
      Extract linear shape input/output tensor shape info from its aten::addmm op.
  
      Parameters
      ----------
      node_group : NodePyGroup
          NodePyGroup object associated with the linear module.
  
      Returns
      -------
      dict
          Include shape of input tensor and shape of output tensor
      """
      for cpp_node in node_group.node_cpps:
          if cpp_node.kind() == "aten::addmm":
              # https://github.com/pytorch/pytorch/blob/1.6/torch/nn/functional.py#L1682
              # inputs of aten::addmm:
              # inputs[0] is bias
              # inputs[1] is input data
              # inputs[2] is weight
              t_input = list(cpp_node.inputs())[1]
              t_output = cpp_node.output()
              assert isinstance(t_input.type(), torch._C.TensorType)
              assert isinstance(t_output.type(), torch._C.TensorType)
              in_shape = t_input.type().sizes()
              out_shape = t_output.type().sizes()
              return {"in_shape": in_shape, "out_shape": out_shape}
      return None
  
imports: import logging
  import queue
  import re
  from collections import defaultdict
  from typing import List, Dict
  import torch
  from torch.utils.tensorboard._pytorch_graph import NodePy, NodePyIO, NodePyOP, GraphPy
label_desc: Use image node_id 5 for calling the TorchModuleGraph obj's underlying member method code with example usage: obj._extract_linear_shape_info(node_group) and returns: None, dict