code: def __gather(self):
      if not self.is_gathered:
          # sanity check
          assert self.cuda_shard is not None
  
          alloc_storage(self.cuda_global_chunk)
          gather_list = list(
              torch.chunk(
                  input=self.cuda_global_chunk,
                  chunks=self.pg_size,
                  dim=0,
              )
          )
          dist.all_gather(gather_list, self.cuda_shard, self.torch_pg)
  
          self.cuda_shard = None
          self.is_gathered = True
  
imports: from dataclasses import dataclass
  from enum import Enum
  from typing import Dict, List, Optional
  import torch
  import torch.distributed
  from torch.distributed import ProcessGroup
  from colossalai.utils import get_current_device
  from colossalai.utils.device import IS_NPU_AVAILABLE
label_desc: Use image node_id 24 for calling the Chunk obj's underlying member method code with example usage: obj.__gather() without return types