class_docstr: Generates a summary of all layers in a :class:`~lightning.pytorch.core.LightningModule`.
  
  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.
  
  Example::
  
      >>> from lightning.pytorch import Trainer
      >>> from lightning.pytorch.callbacks import ModelSummary
      >>> trainer = Trainer(callbacks=[ModelSummary(max_depth=1)])
code: def __init__(
      self, max_depth: int = 1, **summarize_kwargs: Any
  ) -> None:
      self._max_depth: int = max_depth
      self._summarize_kwargs: Dict[str, Any] = summarize_kwargs
  
file_path: pytorch-lightning/src/lightning/pytorch/callbacks/model_summary.py
imports: import logging
  from typing import Any, Dict, List, Tuple, Union
  from typing_extensions import override
  import lightning.pytorch
  from lightning.pytorch.callbacks.callback import Callback
  from lightning.pytorch.utilities.model_summary import DeepSpeedSummary, summarize
  from lightning.pytorch.utilities.model_summary import ModelSummary
  from lightning.pytorch.utilities.model_summary.model_summary import _format_summary_table
label_desc: Use image node_id 1 to create a new ModelSummary object from inherited base classes: Callback with example: obj = ModelSummary(max_depth)