class_docstr: Estimate memory with chunk
class_docstr_tok: ["Estimate","memory","with","chunk"]
code: def _get_tmp_memory(self, node, not_contiguous_list, delete=False):
      mem = 0
      not_contiguous_ops = ["permute"]
  
      if node.op == "call_function" and any(
          n in node.name for n in ["matmul", "reshape"]
      ):
          for n in node.args:
              if n in not_contiguous_list:
                  # matmul won't change origin tensor, but create a tmp copy
                  mem += self._get_node_size(n)
      elif node.op == "call_module":
          for n in node.args:
              if n in not_contiguous_list:
                  # module will just make origin tensor to contiguous
                  if delete:
                      not_contiguous_list.remove(n)
      elif node.op == "call_method" and any(
          i in node.name for i in not_contiguous_ops
      ):
          if node not in not_contiguous_list:
              not_contiguous_list.append(node)
      return mem
  
file_path: ColossalAI/colossalai/autochunk/estimate_memory.py
imports: from typing import Dict, List
  import torch
  from torch.fx.node import Node
  from .utils import NodeMgr, get_node_shape, is_non_memory_node
label_desc: Use image node_id 6 for calling the EstimateMemory obj's underlying member method code with example usage: obj._get_tmp_memory(node, not_contiguous_list, delete) and returns: mem