docstr: :param log_dir: directory in which to store the tensorboard files.
      Can be nested: for example, './logs/my_run/'.
  :param plotting_function: function performing the plotting.
  :param name: name used in TensorBoard.
  :params fig_kw: keyword arguments to be passed to Figure constructor, e.g. `figsize`.
  :params subplots_kw: keyword arguments to be passed to figure.subplots constructor, e.g.
      `nrows`, `ncols`, `sharex`, `sharey`. By default the default values
      from matplotlib.pyplot are used.
docstr_tok: [":","param","log_dir",":","directory","in","which","to","store","the","tensorboard","files",".","Can","be","nested",":","for","example",",","'.\/logs\/my_run\/","'",".",":","param","plotting_function",":","function","performing","the","plotting",".",":","param","name",":","name","used","in","TensorBoard",".",":","params","fig_kw",":","keyword","arguments","to","be","passed","to","Figure","constructor",",","e.g",".","`","figsize","`",".",":","params","subplots_kw",":","keyword","arguments","to","be","passed","to","figure.subplots","constructor",",","e.g",".","`","nrows","`",",","`","ncols","`",",","`","sharex","`",",","`","sharey","`",".","By","default","the","default","values","from","matplotlib.pyplot","are","used","."]
code: def __init__(
      self,
      log_dir: str,
      plotting_function: Union[
          # if len(subplots_kw) > 1 then the function is passed an array of axes
          Callable[
              ["matplotlib.figure.Figure", "matplotlib.axes.Axes"], None
          ],
          Callable[["matplotlib.figure.Figure", AnyNDArray], None],
      ],
      name: Optional[str] = None,
      *,
      fig_kw: Optional[Dict[str, Any]] = None,
      subplots_kw: Optional[Dict[str, Any]] = None,
  ) -> None:
      """
      :param log_dir: directory in which to store the tensorboard files.
          Can be nested: for example, './logs/my_run/'.
      :param plotting_function: function performing the plotting.
      :param name: name used in TensorBoard.
      :params fig_kw: keyword arguments to be passed to Figure constructor, e.g. `figsize`.
      :params subplots_kw: keyword arguments to be passed to figure.subplots constructor, e.g.
          `nrows`, `ncols`, `sharex`, `sharey`. By default the default values
          from matplotlib.pyplot are used.
      """
      super().__init__(log_dir)
      self.plotting_function = plotting_function
      self.name = name
      self.fig_kw = fig_kw or {}
      self.subplots_kw = subplots_kw or {}
  
      try:
          from matplotlib.figure import Figure
      except ImportError:
          raise RuntimeError(
              "ImageToTensorBoard requires the matplotlib package to be installed"
          )
  
      self.fig = Figure(**self.fig_kw)
      if self.subplots_kw != {}:
          self.axes = self.fig.subplots(**self.subplots_kw)
      else:
          self.axes = self.fig.add_subplot(111)
  
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 ImageToTensorBoard object from inherited base classes: ToTensorBoard with example: obj = ImageToTensorBoard(log_dir, plotting_function, name)