class_docstr: A utility class to keep track of average values. For example during training/validation loop,
  we need to accumulate the per-batch metrics and calculate the final average value for the whole dataset.
  When training in multi-gpu environment, with DistributedDataParallel, it will average across the processes.
  
  Example:
  
  .. code-block:: python
  
      from monai.metrics import CumulativeAverage
  
      run_avg = CumulativeAverage()
      batch_size = 8
      for i in range(len(train_set)):
          ...
          val = calc_metric(x,y) #some metric value
          run_avg.append(val, count=batch_size)
  
      val_avg = run_avg.aggregate() #average value
docstr: Reset all  stats
code: def reset(self) -> None:
      """
      Reset all  stats
      """
      self.val: torch.Tensor = None  # type: ignore
      self.sum = torch.tensor(0, dtype=torch.float)
      self.count = torch.tensor(0, dtype=torch.float)
      self.is_distributed = (
          dist.is_available() and dist.is_initialized()
      )
  
file_path: MONAI/monai/metrics/cumulative_average.py
imports: from __future__ import annotations
  import warnings
  from typing import Any
  import torch
  import torch.distributed
  from monai.config import NdarrayOrTensor
label_desc: Use image node_id 2 for calling the CumulativeAverage obj's underlying member method code with example usage: obj.reset() without return types