class_docstr: Group of timers.
class_docstr_tok: ["Group","of","timers","."]
docstr: Write timers to a tensorboard writer
  Note that we only report maximum time across ranks to tensorboard.
docstr_tok: ["Write","timers","to","a","tensorboard","writer","Note","that","we","only","report","maximum","time","across","ranks","to","tensorboard","."]
code: def write(
      self,
      names,
      writer,
      iteration,
      normalizer=1.0,
      reset=False,
      barrier=False,
  ):
      """Write timers to a tensorboard writer
      Note that we only report maximum time across ranks to tensorboard.
      """
      # currently when using add_scalars,
      # torch.utils.add_scalars makes each timer its own run, which
      # polutes the runs list, so we just add each as a scalar
      assert normalizer > 0.0
      name_to_min_max_time = self._get_global_min_max_time(
          names, reset, barrier, normalizer
      )
      if writer is not None:
          for name in name_to_min_max_time:
              _, max_time = name_to_min_max_time[name]
              writer.add_scalar(name + "-time", max_time, iteration)
  
imports: from abc import ABC
  from abc import abstractmethod
  import time
  import torch
label_desc: Use image node_id 8 for calling the Timers obj's underlying member method code with example usage: obj.write(names, writer, iteration, normalizer, reset, barrier) without return types