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 the detail information of the cat operation,
  such the order of the input tensor, the shape of each
  input tensor, the output shape, and the cat dimension.
  
  Parameters
  ----------
  node_group : NodePyGroup
  cpp_node: torch._C.Node
      It should be ```aten::cat``` node
  
  Returns
  -------
  dict
      Include auxiliary information for the cat operation.
      This dict objec has four keys: 'cat_dim', 'out_shape',
      'in_order' and 'in_shape'. cat_dim is the dimension of
      the cat operation to concat the input tensors. out_shape
      is the shape of the output tensor of the cat operation.
      in_order is an ordered list which contains the corresponding
      parent operaion nodes of the input tensors. in_shape is also
      an ordered list that contains the input shapes of the input
      tensor.
docstr_tok: ["Extract","the","detail","information","of","the","cat","operation",",","such","the","order","of","the","input","tensor",",","the","shape","of","each","input","tensor",",","the","output","shape",",","and","the","cat","dimension",".","Parameters","--","--","--","--","--","node_group",":","NodePyGroup","cpp_node",":","torch._C.Node","It","should","be","``","`","aten",":",":cat","``","`","node","Returns","--","--","--","-","dict","Include","auxiliary","information","for","the","cat","operation",".","This","dict","objec","has","four","keys",":","'cat_dim","'",",","'out_shape","'",",","'in_order","'","and","'in_shape","'",".","cat_dim","is","the","dimension","of","the","cat","operation","to","concat","the","input","tensors",".","out_shape","is","the","shape","of","the","output","tensor","of","the","cat","operation",".","in_order","is","an","ordered","list","which","contains","the","corresponding","parent","operaion","nodes","of","the","input","tensors",".","in_shape","is","also","an","ordered","list","that","contains","the","input","shapes","of","the","input","tensor","."]
code: def _extract_cat_info(self, node_group, cpp_node):
      """
      Extract the detail information of the cat operation,
      such the order of the input tensor, the shape of each
      input tensor, the output shape, and the cat dimension.
  
      Parameters
      ----------
      node_group : NodePyGroup
      cpp_node: torch._C.Node
          It should be ```aten::cat``` node
  
      Returns
      -------
      dict
          Include auxiliary information for the cat operation.
          This dict objec has four keys: 'cat_dim', 'out_shape',
          'in_order' and 'in_shape'. cat_dim is the dimension of
          the cat operation to concat the input tensors. out_shape
          is the shape of the output tensor of the cat operation.
          in_order is an ordered list which contains the corresponding
          parent operaion nodes of the input tensors. in_shape is also
          an ordered list that contains the input shapes of the input
          tensor.
      """
      # only suport the cat operation
      assert cpp_node.kind() == CAT_KIND
      cat_info = {}
      # get the shape of the output tensor
      t_output = cpp_node.output()
      out_shape = t_output.type().sizes()
      cat_info["out_shape"] = out_shape
      # get the cat dimension
      inputs = cpp_node.inputs()
      cat_dim = list(inputs)[1].toIValue()
      cat_info["cat_dim"] = cat_dim
      # get the order of the input tensors
      # To get the order of the input tensors, we need
      # to be aware of the topology of the model, which
      # means we should extract the auxiliary information
      # after the build_index function.
      input_order = []
      list_construct_cpp = list(cpp_node.inputs())[0].node()
      input_tensors = list(list_construct_cpp.inputs())
      for _tensor in input_tensors:
          debug_name = _tensor.debugName()
          if debug_name in self.output_to_node:
              input_order.append(
                  self.output_to_node[debug_name].unique_name
              )
          else:
              # the input tensor may be the input tensor of the whole model
              input_order.append(None)
      cat_info["in_order"] = input_order
      input_shapes = [t.type().sizes() for t in input_tensors]
      cat_info["in_shape"] = input_shapes
      return cat_info
  
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 4 for calling the TorchModuleGraph obj's underlying member method code with example usage: obj._extract_cat_info(node_group, cpp_node) and returns: cat_info