class_docstr: Trace all indice information for every node.
  
  Indice is a logical concept. Equal dims can been treated as one indice.
  eg. dim(x1) = [a, b, c]
      dim(x2) = [d, e, f]
      and we have x3 = x1 * x2.
      then a=d, b=e, c=f, due to the broadcast property,
      dim(x1)=dim(x2)=dim(x3)=[a, b, c]
  This class will record every node's dims' indice, compute and source.
  
  Attributes:
      node_list (List)
      indice_trace_list (List): [{"indice": [...], "compute": [...], "source": [...]}, {...}]
      indice_view_list (Dict): not used for now
      indice_count (int): record indice number
  
  Args:
      node_list (List)
class_docstr_tok: ["Trace","all","indice","information","for","every","node",".","Indice","is","a","logical","concept",".","Equal","dims","can","been","treated","as","one","indice",".","eg",".","dim","(","x1",")","=","[","a",",","b",",","c","]","dim","(","x2",")","=","[","d",",","e",",","f","]","and","we","have","x3","=","x1","*","x2",".","then","a=d",",","b=e",",","c=f",",","due","to","the","broadcast","property",",","dim","(","x1",")","=dim","(","x2",")","=dim","(","x3",")","=","[","a",",","b",",","c","]","This","class","will","record","every","node","'s","dims","'","indice",",","compute","and","source",".","Attributes",":","node_list","(","List",")","indice_trace_list","(","List",")",":","[","{","``","indice","''",":","[","...","]",",","``","compute","''",":","[","...","]",",","``","source","''",":","[","...","]","}",",","{","...","}","]","indice_view_list","(","Dict",")",":","not","used","for","now","indice_count","(","int",")",":","record","indice","number","Args",":","node_list","(","List",")"]
code: def trace_indice(self) -> None:
      for idx, node in enumerate(self.node_mgr.get_node_list()):
          node_name = get_node_name(node)
          if node.op == "placeholder":
              self._assign_all_indice(node, idx)
          elif node.op == "call_method":
              if "transpose" == node_name:
                  self._assign_transpose_indice(node, idx)
              elif "permute" == node_name:
                  self._assign_permute_indice(node, idx)
              elif "view" == node_name or "reshape" == node_name:
                  self._assign_view_reshape_indice(node, idx)
              elif "unsqueeze" == node_name:
                  self._assign_unsqueeze_indice(node, idx)
              elif "split" == node_name:
                  self._assign_split_indice(node, idx)
              elif any(
                  i == node_name
                  for i in [
                      "to",
                      "contiguous",
                      "clone",
                      "type",
                      "float",
                  ]
              ):
                  self._assign_no_change_indice(node, idx)
              elif "new_ones" == node_name:
                  self._assign_all_indice(node, idx)
              elif "flatten" == node_name:
                  self._assign_flatten_indice(node, idx)
              elif "expand" == node_name:
                  self._assign_expand_indice(node, idx)
              elif "unbind" == node_name:
                  self._assign_unbind_indice(node, idx)
              elif "softmax" == node_name:
                  self._assign_softmax_indice(node, idx)
              elif any(i == node_name for i in ["size"]):
                  continue
              else:
                  raise NotImplementedError(
                      node_name, "method not implemented yet!"
                  )
          elif node.op == "call_function":
              if "linear" == node_name:
                  self._assign_linear_indice(node, idx)
              elif "cat" == node_name:
                  self._assign_cat_indice(node, idx)
              elif any(n == node_name for n in ["matmul", "bmm"]):
                  self._assign_matmul_indice(node, idx)
              elif "softmax" == node_name:
                  self._assign_softmax_indice(node, idx)
              elif any(
                  n == node_name
                  for n in [
                      "mul",
                      "add",
                      "sigmoid",
                      "relu",
                      "sub",
                      "truediv",
                      "pow",
                      "dropout",
                      "where",
                      "tanh",
                      "exp",
                      "sin",
                      "cos",
                  ]
              ):
                  self._assign_elementwise_indice(node, idx)
              elif "einsum" == node_name:
                  self._assign_einsum_indice(node, idx)
              elif "sum" == node_name:
                  self._assign_sum_indice(node, idx)
              elif "layer_norm" == node_name:
                  self._assign_layernorm_indice(node, idx)
              elif "getitem" == node_name:
                  self._assign_getitem_indice(node, idx)
              elif "addmm" == node_name:
                  self._assign_addmm_indice(node, idx)
              elif "baddbmm" == node_name:
                  self._assign_baddbmm_indice(node, idx)
              elif "interpolate" == node_name:
                  self._assign_interpolate_indice(node, idx)
              elif any(
                  i == node_name
                  for i in [
                      "arange",
                      "ones",
                      "ones_like",
                      "tensor",
                      "empty",
                  ]
              ):
                  self._assign_all_indice(node, idx)
              elif any(
                  i == node_name
                  for i in [
                      "getattr",
                      "eq",
                      "_assert_is_none",
                      "_assert",
                      "finfo",
                  ]
              ):
                  continue
              else:
                  raise NotImplementedError(
                      node_name, "function not implemented yet!"
                  )
          elif node.op == "call_module":
              node_name = get_module_node_name(node)
              if "layernorm" == node_name:
                  self._assign_layernorm_indice(node, idx)
              elif "groupnorm" == node_name:
                  self._assign_groupnorm_indice(node, idx)
              elif "embedding" == node_name:
                  self._assign_embedding_indice(node, idx)
              elif "linear" == node_name:
                  self._assign_linear_indice(node, idx)
              elif "conv2d" == node_name:
                  self._assign_conv2d_indice(node, idx)
              elif "identity" == node_name:
                  self._assign_no_change_indice(node, idx)
              elif any(
                  n == node_name
                  for n in [
                      "sigmoid",
                      "dropout",
                      "relu",
                      "silu",
                      "gelu",
                  ]
              ):
                  self._assign_elementwise_indice(node, idx)
              else:
                  raise NotImplementedError(
                      node_name, "module not implemented yet!"
                  )
          elif node.op == "get_attr":
              self._assign_all_indice(node, idx)  # get param
          elif node.op == "output":
              continue
          else:
              raise NotImplementedError(
                  node.op, "op not implemented yet!"
              )
  
          # limit trace range
          self._clear_trace(idx)
  
imports: import copy
  from typing import Dict, List
  from torch.fx.node import Node
  from .utils import NodeMgr, find_first_tensor_arg, flat_list, get_module_node_name, get_node_name, get_node_shape
label_desc: Use image node_id 44 for calling the TraceIndice obj's underlying member method code with example usage: obj.trace_indice() without return types