class_docstr: Log to local file system in `TensorBoard <https://www.tensorflow.org/tensorboard>`_ format.
  
  Implemented using :class:`~tensorboardX.SummaryWriter`. Logs are saved to
  ``os.path.join(root_dir, name, version)``. This is the recommended logger in Lightning Fabric.
  
  Args:
      root_dir: The root directory in which all your experiments with different names and versions will be stored.
      name: Experiment name. Defaults to ``'lightning_logs'``. If it is the empty string then no per-experiment
          subdirectory is used.
      version: Experiment version. If version is not specified the logger inspects the save
          directory for existing versions, then automatically assigns the next available version.
          If it is a string then it is used as the run-specific subdirectory name,
          otherwise ``'version_${version}'`` is used.
      default_hp_metric: Enables a placeholder metric with key `hp_metric` when `log_hyperparams` is
          called without a metric (otherwise calls to ``log_hyperparams`` without a metric are ignored).
      prefix: A string to put at the beginning of all metric keys.
      sub_dir: Sub-directory to group TensorBoard logs. If a ``sub_dir`` argument is passed
          then logs are saved in ``/root_dir/name/version/sub_dir/``. Defaults to ``None`` in which case
          logs are saved in ``/root_dir/name/version/``.
      \**kwargs: Additional arguments used by :class:`tensorboardX.SummaryWriter` can be passed as keyword
          arguments in this logger. To automatically flush to disk, `max_queue` sets the size
          of the queue for pending logs before flushing. `flush_secs` determines how many seconds
          elapses before flushing.
  
  
  Example::
  
      from lightning.fabric.loggers import TensorBoardLogger
  
      logger = TensorBoardLogger("path/to/logs/root", name="my_model")
      logger.log_hyperparams({"epochs": 5, "optimizer": "Adam"})
      logger.log_metrics({"acc": 0.75})
      logger.finalize("success")
docstr: Record hyperparameters. TensorBoard logs with and without saved hyperparameters are incompatible, the
  hyperparameters are then not displayed in the TensorBoard. Please delete or move the previously saved logs to
  display the new ones with hyperparameters.
  
  Args:
      params: a dictionary-like container with the hyperparameters
      metrics: Dictionary with metric names as keys and measured quantities as values
docstr_tok: ["Record","hyperparameters",".","TensorBoard","logs","with","and","without","saved","hyperparameters","are","incompatible",",","the","hyperparameters","are","then","not","displayed","in","the","TensorBoard",".","Please","delete","or","move","the","previously","saved","logs","to","display","the","new","ones","with","hyperparameters",".","Args",":","params",":","a","dictionary-like","container","with","the","hyperparameters","metrics",":","Dictionary","with","metric","names","as","keys","and","measured","quantities","as","values"]
code: def log_hyperparams(  # type: ignore[override]
      self,
      params: Union[Dict[str, Any], Namespace],
      metrics: Optional[Dict[str, Any]] = None,
  ) -> None:
      """Record hyperparameters. TensorBoard logs with and without saved hyperparameters are incompatible, the
      hyperparameters are then not displayed in the TensorBoard. Please delete or move the previously saved logs to
      display the new ones with hyperparameters.
  
      Args:
          params: a dictionary-like container with the hyperparameters
          metrics: Dictionary with metric names as keys and measured quantities as values
  
      """
      params = _convert_params(params)
  
      # format params into the suitable for tensorboard
      params = _flatten_dict(params)
      params = self._sanitize_params(params)
  
      if metrics is None:
          if self._default_hp_metric:
              metrics = {"hp_metric": -1}
      elif not isinstance(metrics, dict):
          metrics = {"hp_metric": metrics}
  
      if metrics:
          self.log_metrics(metrics, 0)
  
          if _TENSORBOARD_AVAILABLE:
              from torch.utils.tensorboard.summary import hparams
          else:
              from tensorboardX.summary import hparams  # type: ignore[no-redef]
  
          exp, ssi, sei = hparams(params, metrics)
          writer = self.experiment._get_file_writer()
          writer.add_summary(exp)
          writer.add_summary(ssi)
          writer.add_summary(sei)
  
imports: import logging
  import os
  from argparse import Namespace
  from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Union
  from lightning_utilities.core.imports import RequirementCache
  from torch import Tensor
  from torch.nn import Module
  from typing_extensions import override
  from lightning.fabric.loggers.logger import Logger, rank_zero_experiment
  from lightning.fabric.utilities.cloud_io import _is_dir, get_filesystem
  from lightning.fabric.utilities.logger import _add_prefix, _convert_params, _flatten_dict
  from lightning.fabric.utilities.logger import _sanitize_params
  from lightning.fabric.utilities.rank_zero import rank_zero_only, rank_zero_warn
  from lightning.fabric.utilities.types import _PATH
  from lightning.fabric.wrappers import _unwrap_objects
label_desc: Use image node_id 9 for calling the TensorBoardLogger obj's underlying member method code with example usage: obj.log_hyperparams(params, metrics) without return types