class_docstr: Stores the return value of a callback in a TensorBoard.
class_docstr_tok: ["Stores","the","return","value","of","a","callback","in","a","TensorBoard","."]
docstr: :param log_dir: directory in which to store the tensorboard files.
      For example, './logs/my_run/'.
  :param callback: callback to be executed and result written to TensorBoard.
      A callback can have arguments (e.g. data) passed to the function using
      keyword arguments.
      For example:
      ```
      lambda cb(x=None): 2 * x
      task = ScalarToTensorBoard(logdir, cb, "callback")
  
      # specify the argument of the function using kwargs, the names need to match.
      task(step, x=1)
      ```
  :param name: name used in TensorBoard.
docstr_tok: [":","param","log_dir",":","directory","in","which","to","store","the","tensorboard","files",".","For","example",",","'.\/logs\/my_run\/","'",".",":","param","callback",":","callback","to","be","executed","and","result","written","to","TensorBoard",".","A","callback","can","have","arguments","(","e.g",".","data",")","passed","to","the","function","using","keyword","arguments",".","For","example",":","``","`","lambda","cb","(","x=None",")",":","2","*","x","task","=","ScalarToTensorBoard","(","logdir",",","cb",",","``","callback","''",")","#","specify","the","argument","of","the","function","using","kwargs",",","the","names","need","to","match",".","task","(","step",",","x=1",")","``","`",":","param","name",":","name","used","in","TensorBoard","."]
code: def __init__(
      self, log_dir: str, callback: Callable[[], float], name: str
  ) -> None:
      """
      :param log_dir: directory in which to store the tensorboard files.
          For example, './logs/my_run/'.
      :param callback: callback to be executed and result written to TensorBoard.
          A callback can have arguments (e.g. data) passed to the function using
          keyword arguments.
          For example:
          ```
          lambda cb(x=None): 2 * x
          task = ScalarToTensorBoard(logdir, cb, "callback")
  
          # specify the argument of the function using kwargs, the names need to match.
          task(step, x=1)
          ```
      :param name: name used in TensorBoard.
      """
      super().__init__(log_dir)
      self.name = name
      self.callback = callback
  
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 ScalarToTensorBoard object from inherited base classes: ToTensorBoard with example: obj = ScalarToTensorBoard(log_dir, callback, name)