code: def add_to_bucket(self, tensor, allow_oversize=False):
      tensor_size = tensor.numel()
  
      if not allow_oversize and self.will_exceed_max_size(tensor_size):
          msg = (
              f"The param bucket max size {self._max_size} is exceeded"
              + f"by tensor (size {tensor_size})"
          )
          raise RuntimeError(msg)
  
      self._bucket.append(tensor)
      self._current_size += tensor_size
  
file_path: ColossalAI/colossalai/zero/low_level/bookkeeping/tensor_bucket.py
imports: from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
label_desc: Use image node_id 6 for calling the TensorBucket obj's underlying member method code with example usage: obj.add_to_bucket(tensor, allow_oversize) without return types