Skip to content

Commit

Permalink
Make CSVLogger(name: ...) optional str (#19518)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwip committed Feb 23, 2024
1 parent a41528c commit 0235543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/lightning/fabric/loggers/csv_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class CSVLogger(Logger):
Args:
root_dir: The root directory in which all your experiments with different names and versions will be stored.
name: Experiment name. Defaults to ``'lightning_logs'``.
name: Experiment name. Defaults to ``'lightning_logs'``. If name is ``None``, logs
(versions) will be stored to the save dir directly.
version: Experiment version. If version is not specified the logger inspects the save
directory for existing versions, then automatically assigns the next available version.
If the version is specified, and the directory already contains a metrics file for that version, it will be
Expand All @@ -60,7 +61,7 @@ class CSVLogger(Logger):
def __init__(
self,
root_dir: _PATH,
name: str = "lightning_logs",
name: Optional[str] = "lightning_logs",
version: Optional[Union[int, str]] = None,
prefix: str = "",
flush_logs_every_n_steps: int = 100,
Expand Down
5 changes: 3 additions & 2 deletions src/lightning/pytorch/loggers/csv_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class CSVLogger(Logger, FabricCSVLogger):
Args:
save_dir: Save directory
name: Experiment name. Defaults to ``'lightning_logs'``.
name: Experiment name, optional. Defaults to ``'lightning_logs'``. If name is ``None``, logs
(versions) will be stored to the save dir directly.
version: Experiment version. If version is not specified the logger inspects the save
directory for existing versions, then automatically assigns the next available version.
prefix: A string to put at the beginning of metric keys.
Expand All @@ -95,7 +96,7 @@ class CSVLogger(Logger, FabricCSVLogger):
def __init__(
self,
save_dir: _PATH,
name: str = "lightning_logs",
name: Optional[str] = "lightning_logs",
version: Optional[Union[int, str]] = None,
prefix: str = "",
flush_logs_every_n_steps: int = 100,
Expand Down

0 comments on commit 0235543

Please sign in to comment.