From ead2404aac20658b6ca0d99317bbaabc94f99f87 Mon Sep 17 00:00:00 2001 From: Burhanuddin Rangwala Date: Fri, 3 Sep 2021 04:25:12 +0530 Subject: [PATCH] Added doc strings to base logger file (#9232) * added doc strings to base logger * updated docs --- pytorch_lightning/loggers/base.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pytorch_lightning/loggers/base.py b/pytorch_lightning/loggers/base.py index affa92eb53..76331801f9 100644 --- a/pytorch_lightning/loggers/base.py +++ b/pytorch_lightning/loggers/base.py @@ -380,6 +380,9 @@ class LoggerCollection(LightningLoggerBase): @property def experiment(self) -> List[Any]: + """ + Returns a list of experiment objects for all the loggers in the logger collection. + """ return [logger.experiment for logger in self._logger_iterable] def agg_and_log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None): @@ -412,15 +415,24 @@ class LoggerCollection(LightningLoggerBase): @property def save_dir(self) -> Optional[str]: + """ + Returns ``None`` as checkpoints should be saved to default / chosen location when using multiple loggers. + """ # Checkpoints should be saved to default / chosen location when using multiple loggers return None @property def name(self) -> str: + """ + Returns the experiment names for all the loggers in the logger collection joined by an underscore. + """ return "_".join(str(logger.name) for logger in self._logger_iterable) @property def version(self) -> str: + """ + Returns the experiment versions for all the loggers in the logger collection joined by an underscore. + """ return "_".join(str(logger.version) for logger in self._logger_iterable) @@ -450,6 +462,7 @@ class DummyLogger(LightningLoggerBase): @property def experiment(self) -> DummyExperiment: + """Return the experiment object associated with this logger.""" return self._experiment def log_metrics(self, *args, **kwargs) -> None: @@ -460,10 +473,12 @@ class DummyLogger(LightningLoggerBase): @property def name(self) -> str: + """Return the experiment name.""" return "" @property def version(self) -> str: + """Return the experiment version.""" return "" def __getitem__(self, idx) -> "DummyLogger":