code: def __init__(
      self,
      summary_writer: Optional[SummaryWriter] = None,
      log_dir: str = "./runs",
      tag_prefix="",
      interval: int = 1,
      batch_transform: Callable = lambda x: x,
      output_transform: Callable = lambda x: x,
      batch_limit=1,
      device=None,
  ) -> None:
      self.writer = (
          SummaryWriter(log_dir=log_dir)
          if summary_writer is None
          else summary_writer
      )
      self.tag_prefix = tag_prefix
      self.interval = interval
      self.batch_transform = batch_transform
      self.output_transform = output_transform
      self.batch_limit = batch_limit
      self.device = device
  
      self.logger = logging.getLogger(__name__)
  
      if dist.is_initialized():
          self.tag_prefix = f"{self.tag_prefix}r{dist.get_rank()}-"
      self.metric_data: Dict[Any, Any] = dict()
  
file_path: MONAILabel/monailabel/deepedit/handlers.py
imports: import logging
  from typing import TYPE_CHECKING, Any, Callable, Dict, Optional
  import numpy
  import torch
  from monai.config import IgniteInfo
  from monai.utils import min_version, optional_import
  from monai.visualize import plot_2d_or_3d_image
  from torch import distributed
  from torchvision.utils import make_grid
label_desc: Use image node_id 1 to create a new TensorBoard2DImageHandler object  with example: obj = TensorBoard2DImageHandler(summary_writer, log_dir, tag_prefix, interval, batch_transform, output_transform, batch_limit, device)