class_docstr: Helper class to simplify the handling of gradient buckets
class_docstr_tok: ["Helper","class","to","simplify","the","handling","of","gradient","buckets"]
code: def __init__(
      self,
      size: int,
      dtype: torch.dtype,
      device: torch.device,
      destination: int,
  ) -> None:
      super().__init__(size, dtype, device)
  
      self._max_size = size
      self._is_collapsed = False
  
      self.params_checked_in = 0
      self.destination = destination
      self.sent = True
      self.callback: Optional[Callable[[Any], None]] = None
  
imports: from typing import Any, Callable, List, Optional, Union
  import torch
label_desc: Use image node_id 1 to create a new GradBucket object from inherited base classes: Bucket with example: obj = GradBucket(size, dtype, device, destination)