File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
pytorch_lightning/loggers Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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() `
Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments