Skip to content

Commit

Permalink
Keep is_overridden check
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Aug 6, 2021
1 parent 8390f20 commit 2edeb4f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,10 @@ def call_hook(

# next call hook in lightningModule
output = None
model_fx = getattr(pl_module, hook_name, None)
if callable(model_fx):
output = model_fx(*args, **kwargs)
if is_overridden(hook_name, pl_module):
model_fx = getattr(pl_module, hook_name)
if callable(model_fx):
output = model_fx(*args, **kwargs)

# call the accelerator hook
if hook_name not in ("setup", "teardown") and hasattr(self.accelerator, hook_name):
Expand Down

0 comments on commit 2edeb4f

Please sign in to comment.