Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing val/test hooks in LightningModule #5467

Merged
merged 8 commits into from Jan 13, 2021

Conversation

rohitgr7
Copy link
Contributor

@rohitgr7 rohitgr7 commented Jan 11, 2021

What does this PR do?

Fixes #5442

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Check that target branch and milestone match!

Did you have fun?

Make sure you had fun coding 馃檭

@rohitgr7 rohitgr7 changed the base branch from master to release/1.2-dev January 11, 2021 20:11
@Lightning-AI Lightning-AI deleted a comment from review-notebook-app bot Jan 11, 2021
@rohitgr7 rohitgr7 added the design Includes a design discussion label Jan 11, 2021
@rohitgr7 rohitgr7 added this to the 1.2 milestone Jan 11, 2021
Copy link
Member

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rohitgr7 , awesome!

'on_validation_model_train',
'on_epoch_end',
'on_train_epoch_end',
'on_train_end',
'on_fit_end',
'teardown',
]

assert model.called == expected
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall this be updated the way it's done with callback using mock?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be great (in a follow up pr). let me know if you need help

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure 馃憤

Copy link
Member

@SkafteNicki SkafteNicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pytorch_lightning/core/hooks.py Outdated Show resolved Hide resolved
pytorch_lightning/core/hooks.py Outdated Show resolved Hide resolved
pytorch_lightning/core/hooks.py Outdated Show resolved Hide resolved
pytorch_lightning/core/hooks.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 12, 2021

Codecov Report

Merging #5467 (f3d7a4e) into release/1.2-dev (7449ce2) will decrease coverage by 0%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##           release/1.2-dev   #5467   +/-   ##
===============================================
- Coverage               93%     93%   -0%     
===============================================
  Files                  151     151           
  Lines                10641   10645    +4     
===============================================
- Hits                  9860    9858    -2     
- Misses                 781     787    +6     

@rohitgr7 rohitgr7 enabled auto-merge (squash) January 13, 2021 05:50
@rohitgr7 rohitgr7 enabled auto-merge (squash) January 13, 2021 05:50
@rohitgr7 rohitgr7 merged commit 1323cb2 into release/1.2-dev Jan 13, 2021
@rohitgr7 rohitgr7 deleted the feature/on_eval_test_end branch January 13, 2021 06:09
Borda pushed a commit that referenced this pull request Jan 13, 2021
* add missing val/test hooks

* chlog

* None

Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback design Includes a design discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants