Skip to content

Commit 4b1f16d

Browse files
committed
update logging docs
1 parent 839813e commit 4b1f16d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/source/logging.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,17 @@ decorator to make sure that only the first process in DDP training logs data.
128128

129129
class MyLogger(LightningLoggerBase):
130130

131+
@property
131132
def name(self):
132133
return 'MyLogger'
133134

135+
@property
136+
@rank_zero_only
134137
def experiment(self):
135138
# Return the experiment object associated with this logger.
136139
pass
137-
140+
141+
@property
138142
def version(self):
139143
# Return the experiment version, int or str.
140144
return '0.1'
@@ -151,6 +155,7 @@ decorator to make sure that only the first process in DDP training logs data.
151155
# your code to record metrics goes here
152156
pass
153157

158+
@rank_zero_only
154159
def save(self):
155160
# Optional. Any code necessary to save logger data goes here
156161
# If you implement this, remember to call `super().save()`

pytorch_lightning/loggers/wandb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def version(self) -> Optional[str]:
159159
# don't create an experiment if we don't have one
160160
return self._experiment.id if self._experiment else self._id
161161

162+
@rank_zero_only
162163
def finalize(self, status: str) -> None:
163164
# offset future training logged on same W&B run
164165
if self._experiment is not None:

0 commit comments

Comments
 (0)