docstr: Add a tensor to the chunk.
  
  Args:
      tensor (torch.Tensor): a tensor to be added to the chunk
docstr_tok: ["Add","a","tensor","to","the","chunk",".","Args",":","tensor","(","torch.Tensor",")",":","a","tensor","to","be","added","to","the","chunk"]
code: def append_tensor(self, tensor: torch.Tensor):
      """Add a tensor to the chunk.
  
      Args:
          tensor (torch.Tensor): a tensor to be added to the chunk
      """
      # sanity check
      assert self.chunk_temp is not None
      assert tensor.dtype == self.dtype
  
      new_utilized_size = self.utilized_size + tensor.numel()
      # raise exception when the chunk size is exceeded
      if new_utilized_size > self.chunk_size:
          raise ChunkFullError
  
      self.chunk_temp[self.utilized_size : new_utilized_size].copy_(
          tensor.data.flatten()
      )
      assert (
          type(self.chunk_temp) == torch.Tensor
      ), "copy_tensor_to_chunk_slice must use a torch tensor"
      tensor.data = self.chunk_temp[
          self.utilized_size : new_utilized_size
      ].view(tensor.shape)
  
      # record all the information about the tensor
      self.num_tensors += 1
      tensor_state = TensorState.HOLD
      self.tensors_info[tensor] = TensorInfo(
          tensor_state, self.utilized_size, new_utilized_size
      )
      self.tensor_state_cnter[tensor_state] += 1
      self.utilized_size = new_utilized_size
  
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 11 for calling the Chunk obj's underlying member method code with example usage: obj.append_tensor(tensor) without return types