Added doc strings to base logger file (#9232)

* added doc strings to base logger

* updated docs
This commit is contained in:
Burhanuddin Rangwala 2021-09-03 04:25:12 +05:30 committed by GitHub
parent f0788b3bbc
commit ead2404aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -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":