code: def append(self, tensor: Tensor, callback_fn: Callable):
      tensor_size = tensor.numel()
      offset = self.offset
      self.buffer[offset : offset + tensor_size].copy_(tensor.flatten())
      self.offset += tensor_size
  
      # callback will be given the reduced result
      if callback_fn is not None:
          result_view = self.buffer[offset : offset + tensor_size].view(
              tensor.shape
          )
          self.callbacks.append(
              functools.partial(callback_fn, result_view)
          )
  
file_path: ColossalAI/colossalai/legacy/nn/parallel/reducer.py
imports: import functools
  from typing import Callable, Dict, List, Optional, Tuple
  import torch
  import torch.distributed
  from torch import Tensor
  from torch.distributed import ProcessGroup
label_desc: Use image node_id 5 for calling the Bucket obj's underlying member method code with example usage: obj.append(tensor, callback_fn) without return types