-
Notifications
You must be signed in to change notification settings - Fork 405
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
Fix incorrect caching of MetricCollection #2571
Fix incorrect caching of MetricCollection #2571
Conversation
Also update tests to correctly test for Lightning-AI#2211. Also add return deepcopy values of compute
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.
Let's add chlog entry
@SkafteNicki this is everywhere: |
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.
we need to make this work without deepcopy of the values
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2571 +/- ##
======================================
- Coverage 69% 69% -0%
======================================
Files 314 314
Lines 17673 17679 +6
======================================
+ Hits 12186 12189 +3
- Misses 5487 5490 +3 |
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.
Okay, changing the deepcopy
to clone
works out. Thanks for the contribution!
* Fix incorrect caching of MetricCollection Also update tests to correctly test for #2211. Also add return deepcopy values of compute * Update Changelog * fix issues with deepcopy by using .clone --------- Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> (cherry picked from commit 6a23b38)
* Fix incorrect caching of MetricCollection Also update tests to correctly test for #2211. Also add return deepcopy values of compute * Update Changelog * fix issues with deepcopy by using .clone --------- Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> (cherry picked from commit 6a23b38)
What does this PR do?
Fixes #2570. Also provides a better test for #2211. A somewhat larger change is that for this fix (especially the testcases) the compute method needs to return deepcopied values.
Before submitting
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 🙃
📚 Documentation preview 📚: https://torchmetrics--2571.org.readthedocs.build/en/2571/