docstr: :param log_dir: directory in which to store the tensorboard files.
      Can be nested, e.g. ./logs/my_run/
docstr_tok: [":","param","log_dir",":","directory","in","which","to","store","the","tensorboard","files",".","Can","be","nested",",","e.g",".",".\/logs\/my_run\/"]
code: def __init__(self, log_dir: str) -> None:
      """
      :param log_dir: directory in which to store the tensorboard files.
          Can be nested, e.g. ./logs/my_run/
      """
      super().__init__()
      if log_dir not in self.writers:
          self.writers[log_dir] = tf.summary.create_file_writer(log_dir)
      self.file_writer = self.writers[log_dir]
  
imports: from io import BytesIO
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
  import numpy
  import tensorflow
  from ..base import AnyNDArray, Parameter
  from ..models import BayesianModel
  from ..utilities import parameter_dict
  from .base import MonitorTask
label_desc: Use image node_id 1 to create a new ToTensorBoard object from inherited base classes: MonitorTask with example: obj = ToTensorBoard(log_dir)