class_docstr: Callback for logging hyperparameters to TensorBoard.
  
  NOTE: This callback only works in TensorFlow eager mode.
docstr: Create a callback for logging hyperparameters to TensorBoard.
  
  As with the standard `keras.callbacks.TensorBoard` class, each
  callback object is valid for only one call to `model.fit`.
  
  Args:
    writer: The `SummaryWriter` object to which hparams should be
      written, or a logdir (as a `str`) to be passed to
      `tf.summary.create_file_writer` to create such a writer.
    hparams: A `dict` mapping hyperparameters to the values used in
      this session. Keys should be the names of `HParam` objects used
      in an experiment, or the `HParam` objects themselves. Values
      should be Python `bool`, `int`, `float`, or `string` values,
      depending on the type of the hyperparameter.
    trial_id: An optional `str` ID for the set of hyperparameter
      values used in this trial. Defaults to a hash of the
      hyperparameters.
  
  Raises:
    ValueError: If two entries in `hparams` share the same
      hyperparameter name.
code: def __init__(self, writer, hparams, trial_id=None):
      """Create a callback for logging hyperparameters to TensorBoard.
  
      As with the standard `keras.callbacks.TensorBoard` class, each
      callback object is valid for only one call to `model.fit`.
  
      Args:
        writer: The `SummaryWriter` object to which hparams should be
          written, or a logdir (as a `str`) to be passed to
          `tf.summary.create_file_writer` to create such a writer.
        hparams: A `dict` mapping hyperparameters to the values used in
          this session. Keys should be the names of `HParam` objects used
          in an experiment, or the `HParam` objects themselves. Values
          should be Python `bool`, `int`, `float`, or `string` values,
          depending on the type of the hyperparameter.
        trial_id: An optional `str` ID for the set of hyperparameter
          values used in this trial. Defaults to a hash of the
          hyperparameters.
  
      Raises:
        ValueError: If two entries in `hparams` share the same
          hyperparameter name.
      """
      # Defer creating the actual summary until we write it, so that the
      # timestamp is correct. But create a "dry-run" first to fail fast in
      # case the `hparams` are invalid.
      self._hparams = dict(hparams)
      self._trial_id = trial_id
      summary_v2.hparams_pb(self._hparams, trial_id=self._trial_id)
      if writer is None:
          raise TypeError(
              "writer must be a `SummaryWriter` or `str`, not None"
          )
      elif isinstance(writer, str):
          self._writer = tf.compat.v2.summary.create_file_writer(writer)
      else:
          self._writer = writer
  
file_path: tensorboard/tensorboard/plugins/hparams/_keras.py
imports: import tensorflow
  from tensorboard.plugins.hparams import api_pb2
  from tensorboard.plugins.hparams import summary
  from tensorboard.plugins.hparams import summary_v2
label_desc: Use image node_id 1 to create a new Callback object from inherited base classes: keras.callbacks with example: obj = Callback(writer, hparams, trial_id)