class_docstr: Simple logger for TensorBoard.
  
  On construction, the logger creates a new events file that logs
  will be written to.  If the environment variable `RANK` is defined,
  logger will only log if RANK = 0.
  
  Note:
      If using this logger with distributed training:
  
      - This logger should be constructed on all ranks
      - This logger can call collective operations
      - Logs will be written on rank 0 only
      - Logger must be constructed synchronously *after* initializing the distributed process group.
  
  Args:
      path (str): path to write logs to
      *args: Extra positional arguments to pass to SummaryWriter
      **kwargs: Extra keyword arguments to pass to SummaryWriter
  
  Examples::
  
      from torchtnt.utils.loggers import TensorBoardLogger
      logger = TensorBoardLogger(path="tmp/tb_logs")
      logger.log("accuracy", 23.56, 10)
      logger.close()
class_docstr_tok: ["Simple","logger","for","TensorBoard",".","On","construction",",","the","logger","creates","a","new","events","file","that","logs","will","be","written","to",".","If","the","environment","variable","`","RANK","`","is","defined",",","logger","will","only","log","if","RANK","=","0",".","Note",":","If","using","this","logger","with","distributed","training",":","-","This","logger","should","be","constructed","on","all","ranks","-","This","logger","can","call","collective","operations","-","Logs","will","be","written","on","rank","0","only","-","Logger","must","be","constructed","synchronously","*","after","*","initializing","the","distributed","process","group",".","Args",":","path","(","str",")",":","path","to","write","logs","to","*","args",":","Extra","positional","arguments","to","pass","to","SummaryWriter","*","*","kwargs",":","Extra","keyword","arguments","to","pass","to","SummaryWriter","Examples",":",":","from","torchtnt.utils.loggers","import","TensorBoardLogger","logger","=","TensorBoardLogger","(","path=","''","tmp\/tb_logs","''",")","logger.log","(","``","accuracy","''",",","23.56",",","10",")","logger.close","(",")"]
docstr: Log multiple values to TensorBoard.
  Args:
      main_tag (string): Parent name for the tags
      tag_scalar_dict (dict): dictionary of tag name and scalar value
      global_step (int): global step value to record
      walltime (float): Optional override default walltime (time.time())
  Returns:
      None
docstr_tok: ["Log","multiple","values","to","TensorBoard",".","Args",":","main_tag","(","string",")",":","Parent","name","for","the","tags","tag_scalar_dict","(","dict",")",":","dictionary","of","tag","name","and","scalar","value","global_step","(","int",")",":","global","step","value","to","record","walltime","(","float",")",":","Optional","override","default","walltime","(","time.time","(",")",")","Returns",":","None"]
code: def log_scalars(
      self: TensorBoardLogger,
      main_tag: str,
      tag_scalar_dict: Dict[str, Union[float, int]],
      global_step: Optional[int] = None,
      walltime: Optional[float] = None,
  ) -> None:
      """Log multiple values to TensorBoard.
      Args:
          main_tag (string): Parent name for the tags
          tag_scalar_dict (dict): dictionary of tag name and scalar value
          global_step (int): global step value to record
          walltime (float): Optional override default walltime (time.time())
      Returns:
          None
      """
      if self._writer:
          self._writer.add_scalars(
              main_tag=main_tag,
              tag_scalar_dict=tag_scalar_dict,
              global_step=global_step,
              walltime=walltime,
          )
  
imports: from __future__ import annotations
  import atexit
  import logging
  from typing import Any, Dict, List, Mapping, Optional, Union
  import torch.distributed
  from torch.utils.tensorboard import SummaryWriter
  from torchtnt.utils.distributed import get_global_rank, PGWrapper
  from torchtnt.utils.loggers.logger import MetricLogger, Scalar
label_desc: Use image node_id 12 for calling the TensorBoardLogger obj's underlying member method code with example usage: obj.log_scalars(main_tag, tag_scalar_dict, global_step, walltime) without return types