class_docstr: Generates a summary of all layers in a :class:`~lightning.pytorch.core.LightningModule` with `rich text
  formatting <https://github.com/Textualize/rich>`_.
  
  Install it with pip:
  
  .. code-block:: bash
  
      pip install rich
  
  .. code-block:: python
  
      from lightning.pytorch import Trainer
      from lightning.pytorch.callbacks import RichModelSummary
  
      trainer = Trainer(callbacks=RichModelSummary())
  
  You could also enable ``RichModelSummary`` using the :class:`~lightning.pytorch.callbacks.RichProgressBar`
  
  .. code-block:: python
  
      from lightning.pytorch import Trainer
      from lightning.pytorch.callbacks import RichProgressBar
  
      trainer = Trainer(callbacks=RichProgressBar())
  
  Args:
      max_depth: The maximum depth of layer nesting that the summary will include. A value of 0 turns the
          layer summary off.
      **summarize_kwargs: Additional arguments to pass to the `summarize` method.
  
  Raises:
      ModuleNotFoundError:
          If required `rich` package is not installed on the device.
code: def __init__(
      self, max_depth: int = 1, **summarize_kwargs: Any
  ) -> None:
      if not _RICH_AVAILABLE:
          raise ModuleNotFoundError(
              "`RichModelSummary` requires `rich` to be installed. Install it by running `pip install -U rich`."
          )
      super().__init__(max_depth, **summarize_kwargs)
  
file_path: pytorch-lightning/src/lightning/pytorch/callbacks/rich_model_summary.py
imports: from typing import Any, List, Tuple
  from typing_extensions import override
  from lightning.pytorch.callbacks import ModelSummary
  from lightning.pytorch.callbacks.progress.rich_progress import _RICH_AVAILABLE
  from lightning.pytorch.utilities.model_summary import get_human_readable_count
label_desc: Use image node_id 1 to create a new RichModelSummary object from inherited base classes: ModelSummary with example: obj = RichModelSummary(max_depth)