Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added doc strings to base logger file #9232

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pytorch_lightning/loggers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ def update_agg_funcs(

@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):
Expand Down Expand Up @@ -412,15 +415,24 @@ def close(self) -> None:

@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)


Expand Down Expand Up @@ -450,6 +462,7 @@ def __init__(self):

@property
def experiment(self) -> DummyExperiment:
"""Return the experiment object associated with this logger."""
return self._experiment

def log_metrics(self, *args, **kwargs) -> None:
Expand All @@ -460,10 +473,12 @@ def log_hyperparams(self, *args, **kwargs) -> None:

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