From 2b232d3fbd213da17b3ee7274d888160db34dbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Mon, 19 Apr 2021 16:08:09 +0200 Subject: [PATCH] fix docs rendering in datamodule (#7064) * [docs]: add newline to correctly render Example * whitespace Co-authored-by: Matthew Sarmiento --- pytorch_lightning/core/datamodule.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pytorch_lightning/core/datamodule.py b/pytorch_lightning/core/datamodule.py index 4178c9eeac..2dd6f0b76a 100644 --- a/pytorch_lightning/core/datamodule.py +++ b/pytorch_lightning/core/datamodule.py @@ -58,7 +58,7 @@ def track_data_hook_calls(fn): - When ``dm.prepare_data()`` is called, ``dm.has_prepared_data`` gets set to True - When ``dm.setup()``, ``dm.has_setup_{fit,validate,test}`` get set to True - When ``dm.setup(stage)`` is called, where stage is any of ``{fit,validate,test,predict}``. - Its corresponding `dm_has_setup_{stage}` attribute gets set to True + Its corresponding `dm_has_setup_{stage}` attribute gets set to True - ``dm.teardown()`` and ``dm.teardown(stage)`` act exactly like ``dm.setup`` Args: @@ -319,11 +319,12 @@ class LightningDataModule(CheckpointHooks, DataHooks, metaclass=_DataModuleWrapp Args: args: The parser or namespace to take arguments from. Only known arguments will be - parsed and passed to the :class:`LightningDataModule`. + parsed and passed to the :class:`LightningDataModule`. **kwargs: Additional keyword arguments that may override ones in the parser or namespace. - These must be valid DataModule arguments. + These must be valid DataModule arguments. Example:: + parser = ArgumentParser(add_help=False) parser = LightningDataModule.add_argparse_args(parser) module = LightningDataModule.from_argparse_args(args)