class_docstr: A timer class that supports multiple named timers.
  A named timer can be used multiple times, in which case the average
  dt will be returned.
  A named timer cannot be started if it is already currently running.
  Use case: measuring execution of multiple code blocks.
docstr: Args:
      reduction (str): reduction over multiple timings of the same timer
                       (none - returns the list instead of a scalar)
      sync_cuda (bool): if True torch.cuda.synchronize() is called for start/stop
      buffer_size (int): if positive, limits the number of stored measures per name
docstr_tok: ["Args",":","reduction","(","str",")",":","reduction","over","multiple","timings","of","the","same","timer","(","none","-","returns","the","list","instead","of","a","scalar",")","sync_cuda","(","bool",")",":","if","True","torch.cuda.synchronize","(",")","is","called","for","start\/stop","buffer_size","(","int",")",":","if","positive",",","limits","the","number","of","stored","measures","per","name"]
code: def __init__(self, reduction="mean", sync_cuda=False, buffer_size=-1):
      """
      Args:
          reduction (str): reduction over multiple timings of the same timer
                           (none - returns the list instead of a scalar)
          sync_cuda (bool): if True torch.cuda.synchronize() is called for start/stop
          buffer_size (int): if positive, limits the number of stored measures per name
      """
      if reduction not in self._REDUCTION_TYPE:
          raise ValueError(
              f"Unknown reduction={reduction} please use one of {self._REDUCTION_TYPE}"
          )
  
      self._reduction = reduction
      self._sync_cuda = sync_cuda
      self._buffer_size = buffer_size
  
      self.reset()
  
file_path: NeMo/nemo/utils/timers.py
imports: import time
  import numpy
  import torch
label_desc: Use image node_id 1 to create a new NamedTimer object from inherited base classes: object with example: obj = NamedTimer(reduction, sync_cuda, buffer_size)