class_docstr: Estimate memory with chunk
class_docstr_tok: ["Estimate","memory","with","chunk"]
docstr: remove deactivate nodes from active nodes
docstr_tok: ["remove","deactivate","nodes","from","active","nodes"]
code: def _remove_deactive_node(
      self,
      user_idx: int,
      user: Node,
      active_nodes: List,
      delete_node_dict: List,
      kept_nodes: List = None,
  ) -> None:
      """
      remove deactivate nodes from active nodes
      """
      if kept_nodes is None:
          kept_nodes = []
      if user.op in ("output",):
          return
  
      for node in list(active_nodes.keys()):
          # dont delete kept nodes
          if node in kept_nodes:
              continue
          # should be deleted
          if delete_node_dict[node] <= user_idx:
              active_nodes.pop(node)
  
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 5 for calling the EstimateMemory obj's underlying member method code with example usage: obj._remove_deactive_node(user_idx, user, active_nodes, delete_node_dict, kept_nodes) without return types