class_docstr: Estimate memory with chunk
class_docstr_tok: ["Estimate","memory","with","chunk"]
docstr: build delete node dict, means node should be deleted at what time
docstr_tok: ["build","delete","node","dict",",","means","node","should","be","deleted","at","what","time"]
code: def _build_delete_node_dict(self, node_mgr: NodeMgr) -> Dict:
      """
      build delete node dict, means node should be deleted at what time
      """
      delete_node_dict = {}
      for idx, node in enumerate(node_mgr.get_node_list()):
          # skip non shape node
          if get_node_shape(node) is None:
              continue
          # dont remove free nodes
          elif node.op == "placeholder":
              delete_node_dict[node] = len(node_mgr.get_node_list())
          # node no user
          elif len(node.users) == 0:
              delete_node_dict[node] = idx
          # log max use
          else:
              node_user_idx = [
                  node_mgr.find_node_idx(i) for i in node.users.keys()
              ]
              delete_node_dict[node] = max(node_user_idx)
      return delete_node_dict
  
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 4 for calling the EstimateMemory obj's underlying member method code with example usage: obj._build_delete_node_dict(node_mgr) and returns: delete_node_dict