Skip to content

Commit 931ac6b

Browse files
committed
Rely on validator
1 parent e042254 commit 931ac6b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pytorch_lightning/core/lightning.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def log(
270270
sync_dist_op: Union[Any, str] = 'mean',
271271
sync_dist_group: Optional[Any] = None,
272272
add_dataloader_idx: bool = True,
273-
):
273+
) -> None:
274274
"""
275275
Log a key, value
276276
@@ -310,16 +310,6 @@ def log(
310310
each dataloader to not mix values
311311
"""
312312
if self._results is not None:
313-
if 'epoch_end' in self._current_fx_name and on_step:
314-
raise MisconfigurationException(
315-
f'`self.log(on_step=True)` cannot be used on the {self._current_fx_name} hook'
316-
)
317-
318-
if 'epoch_end' in self._current_fx_name and not on_epoch:
319-
raise MisconfigurationException(
320-
f'`self.log(on_epoch=False)` cannot be used on the {self._current_fx_name} hook'
321-
)
322-
323313
# TODO: if logged twice fail with crash
324314

325315
# set the default depending on the fx_name
@@ -370,7 +360,7 @@ def log_dict(
370360
sync_dist_op: Union[Any, str] = 'mean',
371361
sync_dist_group: Optional[Any] = None,
372362
add_dataloader_idx: bool = True,
373-
):
363+
) -> None:
374364
"""
375365
Log a dictonary of values at once
376366

0 commit comments

Comments
 (0)