class_docstr: Monitoring task that creates a sensible TensorBoard for a model.
  
  Monitors all the model's parameters for which their name matches with `keywords_to_monitor`.
  By default, "kernel" and "likelihood" are elements of `keywords_to_monitor`.
  
  Example::
  
      keyword = "kernel", parameter = "kernel.lengthscale" => match
      keyword = "variational", parameter = "kernel.lengthscale" => no match
class_docstr_tok: ["Monitoring","task","that","creates","a","sensible","TensorBoard","for","a","model",".","Monitors","all","the","model","'s","parameters","for","which","their","name","matches","with","`","keywords_to_monitor","`",".","By","default",",","``","kernel","''","and","``","likelihood","''","are","elements","of","`","keywords_to_monitor","`",".","Example",":",":","keyword","=","``","kernel","''",",","parameter","=","``","kernel.lengthscale","''","=",">","match","keyword","=","``","variational","''",",","parameter","=","``","kernel.lengthscale","''","=",">","no","match"]
docstr: :param name: identifier used in tensorboard
  :param param: parameter to be stored in tensorboard
docstr_tok: [":","param","name",":","identifier","used","in","tensorboard",":","param","param",":","parameter","to","be","stored","in","tensorboard"]
code: def _summarize_parameter(
      self, name: str, param: Union[Parameter, tf.Variable]
  ) -> None:
      """
      :param name: identifier used in tensorboard
      :param param: parameter to be stored in tensorboard
      """
      param = tf.reshape(param, (-1,))
      size = param.shape[0]
  
      if not isinstance(size, int):
          raise ValueError(
              f"The monitoring can not be autographed as the size of a parameter {param} "
              "is unknown at compile time. If compiling the monitor task is important, "
              "make sure the shape of all parameters is known beforehand. Otherwise, "
              "run the monitor outside the `tf.function`."
          )
      if size == 1:
          # if there's only one element do not add a numbered suffix
          tf.summary.scalar(name, param[0], step=self.current_step)
      else:
          it = (
              range(size)
              if self.max_size == -1
              else range(min(size, self.max_size))
          )
          for i in it:
              tf.summary.scalar(
                  f"{name}[{i}]", param[i], step=self.current_step
              )
  
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 3 for calling the ModelToTensorBoard obj's underlying member method code with example usage: obj._summarize_parameter(name, param) without return types