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")
code: def log_graph(
      self, model: Module, input_array: Optional[Tensor] = None
  ) -> None:
      model_example_input = getattr(model, "example_input_array", None)
      input_array = (
          model_example_input if input_array is None else input_array
      )
      model = _unwrap_objects(model)
  
      if input_array is None:
          rank_zero_warn(
              "Could not log computational graph to TensorBoard: The `model.example_input_array` attribute"
              " is not set or `input_array` was not given."
          )
      elif not isinstance(input_array, (Tensor, tuple)):
          rank_zero_warn(
              "Could not log computational graph to TensorBoard: The `input_array` or `model.example_input_array`"
              f" has type {type(input_array)} which can't be traced by TensorBoard. Make the input array a tuple"
              f" representing the positional arguments to the model's `forward()` implementation."
          )
      elif callable(
          getattr(model, "_on_before_batch_transfer", None)
      ) and callable(
          getattr(model, "_apply_batch_transfer_handler", None)
      ):
          # this is probably is a LightningModule
          input_array = model._on_before_batch_transfer(input_array)
          input_array = model._apply_batch_transfer_handler(input_array)
          self.experiment.add_graph(model, input_array)
      else:
          self.experiment.add_graph(model, input_array)
  
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 10 for calling the TensorBoardLogger obj's underlying member method code with example usage: obj.log_graph(model, input_array) without return types