class_docstr: Log statistics writer implementation for Tensorboard.
  :param log_dir: log_dir for TensorBoard
  :param tensorboard_render_figure: Indicates whether to visualize the actions taken in TensorBoard.
class_docstr_tok: ["Log","statistics","writer","implementation","for","Tensorboard",".",":","param","log_dir",":","log_dir","for","TensorBoard",":","param","tensorboard_render_figure",":","Indicates","whether","to","visualize","the","actions","taken","in","TensorBoard","."]
code: def __init__(self, log_dir: str, tensorboard_render_figure: bool):
      self.tensorboard_render_figure = tensorboard_render_figure
  
      self.summary_writer = SummaryWriter(log_dir=log_dir)
  
      self.previous_step_tags = set()
      self.this_step_tags = set()
      GlobalLogState.hook_on_log_step.append(self.on_log_step_increment)
  
      class _IgnoreTensorboardCheckNaN(logging.Filter):
          def filter(self, record):
              """Filter out a logging warning message caused by a unnecessary NaN check in tensorboard/x2num.py"""
              return not (
                  record.funcName == "check_nan"
                  and record.msg == "NaN or Inf found in input tensor."
              )
  
      # this relies on knowing the variable name in my_module
      logging.getLogger().addFilter(_IgnoreTensorboardCheckNaN())
  
file_path: maze/maze/core/log_stats/log_stats_writer_tensorboard.py
imports: import logging
  import math
  import numbers
  from typing import Callable, Union, List, Optional
  import numpy
  from torch.utils.tensorboard import SummaryWriter
  from maze.core.annotations import override
  from maze.core.log_stats.log_stats import LogStatsWriter, LogStats, GlobalLogState
label_desc: Use image node_id 1 to create a new LogStatsWriterTensorboard object from inherited base classes: LogStatsWriter with example: obj = LogStatsWriterTensorboard(log_dir, tensorboard_render_figure)