class_docstr: Stateful Tensor Manager, inspired from PatrickStar
  
  PatrickStar: Parallel Training of Pre-trained Models via Chunk-based Memory Management
  https://arxiv.org/abs/2108.05818
class_docstr_tok: ["Stateful","Tensor","Manager",",","inspired","from","PatrickStar","PatrickStar",":","Parallel","Training","of","Pre-trained","Models","via","Chunk-based","Memory","Management","https",":","\/\/arxiv.org\/abs\/2108.05818"]
code: def __init__(
      self, tensor_placement_policy: TensorPlacementPolicy
  ) -> None:
      self._tensor_placement_policy: TensorPlacementPolicy = (
          tensor_placement_policy
      )
      self._stateful_tensor_list: List[StatefulTensor] = []
  
      self._compute_list: List[StatefulTensor] = []
      self._compute_idx: int = -1
  
      self._cpu_gpu_move_volume = 0
      self._layout_time = 0
      self._evict_time = 0
      self._warmup = True
  
file_path: ColossalAI/colossalai/legacy/zero/gemini/stateful_tensor_mgr.py
imports: import functools
  import types
  from time import time
  from typing import List
  from colossalai.utils.device import get_current_device
  from .stateful_tensor import StatefulTensor, TensorState
  from .tensor_placement_policy import TensorPlacementPolicy
  from .tensor_utils import colo_model_data_tensor_move_inline
label_desc: Use image node_id 1 to create a new StatefulTensorMgr object from inherited base classes: object with example: obj = StatefulTensorMgr(tensor_placement_policy)