From ca6befb2376ebcd05fb24d44a8f11c0046dc0f2d Mon Sep 17 00:00:00 2001 From: Felonious-Spellfire Date: Thu, 1 Sep 2022 10:54:46 -0700 Subject: [PATCH 1/2] Updated basic debugging Updated basic debugging topic --- docs/source-pytorch/debug/debugging_basic.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/source-pytorch/debug/debugging_basic.rst b/docs/source-pytorch/debug/debugging_basic.rst index 147285f9fe798..1b92860919fd6 100644 --- a/docs/source-pytorch/debug/debugging_basic.rst +++ b/docs/source-pytorch/debug/debugging_basic.rst @@ -128,6 +128,15 @@ To add the child modules to the summary add a :class:`~pytorch_lightning.callbac trainer = Trainer(callbacks=[ModelSummary(max_depth=-1)]) +To print the model summary if ``.fit()`` is not called: + +.. testcode:: + + from pytorch_lightning.utilities import ModelSummary + + summary = ModelSummary(model, max_depth=-1) + print(summary) + To turn off the autosummary use: .. code:: python From 95f623008acdbf3697f2869f92fdfd61e09ab0ca Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Fri, 2 Sep 2022 01:46:26 +0530 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Adrian Wälchli --- docs/source-pytorch/debug/debugging_basic.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source-pytorch/debug/debugging_basic.rst b/docs/source-pytorch/debug/debugging_basic.rst index 1b92860919fd6..14d059af1067c 100644 --- a/docs/source-pytorch/debug/debugging_basic.rst +++ b/docs/source-pytorch/debug/debugging_basic.rst @@ -130,10 +130,11 @@ To add the child modules to the summary add a :class:`~pytorch_lightning.callbac To print the model summary if ``.fit()`` is not called: -.. testcode:: +.. code-block:: python - from pytorch_lightning.utilities import ModelSummary + from pytorch_lightning.utilities.model_summary import ModelSummary + model = LitModel() summary = ModelSummary(model, max_depth=-1) print(summary)