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

Call on_before_zero_grad model hook #1493

Merged
merged 5 commits into from
Apr 16, 2020
Merged

Call on_before_zero_grad model hook #1493

merged 5 commits into from
Apr 16, 2020

Conversation

awaelchli
Copy link
Member

@awaelchli awaelchli commented Apr 14, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

As reported in the issue fixes #1481 the on_before_zero_grad model hook was never called.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 馃檭

@mergify mergify bot requested a review from a team April 14, 2020 21:00
@Borda Borda added the bug Something isn't working label Apr 14, 2020
@Borda Borda added this to the 0.7.4 milestone Apr 14, 2020
@Borda Borda requested a review from a team April 14, 2020 21:14
@codecov
Copy link

codecov bot commented Apr 14, 2020

Codecov Report

Merging #1493 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #1493   +/-   ##
======================================
  Coverage      91%     91%           
======================================
  Files          67      67           
  Lines        3753    3754    +1     
======================================
+ Hits         3407    3408    +1     
  Misses        346     346           

@awaelchli
Copy link
Member Author

@PyTorchLightning/core-contributors I added the file "tests/trainer/test_hooks.py", is it ok?

@Borda Borda added the ready PRs ready to be merged label Apr 14, 2020
@Borda
Copy link
Member

Borda commented Apr 14, 2020

@PyTorchLightning/core-contributors I added the file "tests/trainer/test_hooks.py", is it ok?

rather move them to tests/models

@mergify
Copy link
Contributor

mergify bot commented Apr 15, 2020

This pull request is now in conflict... :(

@williamFalcon williamFalcon merged commit 3c549e8 into Lightning-AI:master Apr 16, 2020
@awaelchli awaelchli deleted the bugfix/on_before_zero_grad branch April 24, 2020 01:03
tullie pushed a commit to tullie/pytorch-lightning that referenced this pull request Jun 7, 2020
* call on_before_zero_grad

* update changelog

* add note about overriding both hooks

* added test

* move test_hooks.py to models folder
@Borda Borda modified the milestones: 0.7.4, v0.7.x Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on_before_zero_grad hook
3 participants