code: def __init__(
      self,
      chunk_manager: ChunkManager,
      mem_stats_collector: Optional[ChunkMemStatsCollector] = None,
      shard_param_frac: float = 1.0,
      offload_optim_frac: float = 0.0,
      offload_param_frac: float = 0.0,
      **kwargs,
  ) -> None:
      super().__init__(
          chunk_manager, mem_stats_collector=mem_stats_collector
      )
      if offload_param_frac > 0.0 and (
          shard_param_frac != 1.0 or offload_optim_frac != 1.0
      ):
          warnings.warn(
              "offload_param_frac is ignored when shard_param_frac != 1.0 or offload_optim_frac != 1.0"
          )
          offload_param_frac = 0.0
      self.shard_param_frac = shard_param_frac
      self.offload_optim_frac = offload_optim_frac
      self.offload_param_frac = offload_param_frac
      # these should be initialized in setup_grads_device
      self.keep_gathered_chunk_mem = 0.0
      self.keep_cuda_chunk_mem = 0.0
  
imports: import functools
  import warnings
  from abc import ABC, abstractmethod
  from time import time
  from typing import Dict, List, Optional, Tuple, Type
  import torch
  from colossalai.utils import get_current_device
  from colossalai.utils.memory import colo_device_memory_capacity
  from colossalai.zero.gemini.chunk import Chunk
  from .chunk import Chunk, ChunkManager
  from .memory_tracer import ChunkMemStatsCollector
label_desc: Use image node_id 1 to create a new StaticPlacementPolicy object from inherited base classes: PlacementPolicy with example: obj = StaticPlacementPolicy(chunk_manager, mem_stats_collector, shard_param_frac, offload_optim_frac, offload_param_frac)