-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add persistent flag to Metric.add_state #4195
Conversation
Hello @teddykoker! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-10-16 16:16:47 UTC |
Can we add test for this? One metric class with and one without the persistent flag on their state, and then check their state dict. |
Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Codecov Report
@@ Coverage Diff @@
## master #4195 +/- ##
======================================
Coverage 93% 93%
======================================
Files 103 103
Lines 7844 7847 +3
======================================
+ Hits 7277 7280 +3
Misses 567 567 |
Why would someone want to save a metric to the state_dict? I feel pretty natural to add or update metrics of an already trained module. For example, adding the new metrics from the |
What does this PR do?
Adds
persistent
flag to Metrics, to allow the user to disable state beingadded to the
state_dict
.