class_docstr: TensorboardEventHandler is an event handler that will write known events to
  the provided SummaryWriter.
  
  This currently only supports ``torch.monitor.Stat`` events which are logged
  as scalars.
  
  Example:
      >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_MONITOR)
      >>> # xdoctest: +REQUIRES(module:tensorboard)
      >>> from torch.utils.tensorboard import SummaryWriter
      >>> from torch.monitor import TensorboardEventHandler, register_event_handler
      >>> writer = SummaryWriter("log_dir")
      >>> register_event_handler(TensorboardEventHandler(writer))
class_docstr_tok: ["TensorboardEventHandler","is","an","event","handler","that","will","write","known","events","to","the","provided","SummaryWriter",".","This","currently","only","supports","``","torch.monitor.Stat","``","events","which","are","logged","as","scalars",".","Example",":",">",">",">","#","xdoctest",":","+REQUIRES","(","env",":","TORCH_DOCTEST_MONITOR",")",">",">",">","#","xdoctest",":","+REQUIRES","(","module",":","tensorboard",")",">",">",">","from","torch.utils.tensorboard","import","SummaryWriter",">",">",">","from","torch.monitor","import","TensorboardEventHandler",",","register_event_handler",">",">",">","writer","=","SummaryWriter","(","``","log_dir","''",")",">",">",">","register_event_handler","(","TensorboardEventHandler","(","writer",")",")"]
code: def __call__(self, event: Event) -> None:
      if event.name == STAT_EVENT:
          for k, v in event.data.items():
              self._writer.add_scalar(
                  k, v, walltime=event.timestamp.timestamp()
              )
  
imports: from torch._C._monitor import *
  from typing import TYPE_CHECKING
label_desc: Use image node_id 2 for calling the TensorboardEventHandler obj's underlying member method code with example usage: obj.__call__(event) without return types