code: def setup_grads_device(
      self,
      params: List[torch.Tensor],
      grads_device_map: Dict[torch.Tensor, torch.device],
  ) -> None:
      for p in params:
          chunk = self.chunk_manager.get_chunk(p)
          # init offload optim settings
          # keep gathered chunks are in CUDA
          if chunk.keep_gathered:
              grads_device_map[p] = get_current_device()
          else:
              grads_device_map[p] = torch.device("cpu")
  
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 4 for calling the AutoPlacementPolicy obj's underlying member method code with example usage: obj.setup_grads_device(params, grads_device_map) without return types