class_docstr: Maintains running average for a stream of batched data, in which the outer dimension is
  assumed to be batches
  
  Call .restart() to clear added values and to start a new round of averaging
docstr: add a batch of values to be further averaged
  
  Parameters
  ----------
  values : Tensor
  
  Raises
  ------
  ValueError
      if `values` is 0-dimensional
docstr_tok: ["add","a","batch","of","values","to","be","further","averaged","Parameters","--","--","--","--","--","values",":","Tensor","Raises","--","--","--","ValueError","if","`","values","`","is","0-dimensional"]
code: def update(self, values: Tensor) -> None:
      """
      add a batch of values to be further averaged
  
      Parameters
      ----------
      values : Tensor
  
      Raises
      ------
      ValueError
          if `values` is 0-dimensional
      """
      if values.ndim < 1:
          raise ValueError("A scalar tensor is provided.")
      if self.averaging:
          self._cum_values += values.mean().item() * values.size(0)
      else:
          self._cum_values += values.sum().item()
      self._count += values.size(0)
      self.cache = values.sum().item() / values.size(0)
  
imports: from __future__ import annotations
  import time
  import warnings
  from abc import ABC, abstractmethod
  from typing import Optional, Union
  from torch import Tensor
  from ..engine.distributed import reduce_value
label_desc: Use image node_id 2 for calling the BatchAverageMeter obj's underlying member method code with example usage: obj.update(values) without return types