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

Fix aggregation metrics with zero tensors #1070

Merged
merged 7 commits into from Jun 7, 2022

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Jun 6, 2022

What does this PR do?

Fixes #1063
Change if any(value) to if value.numel() != 0 to check if metric is empty.
Also adds the full_state_update to aggregation metrics as it was missing.

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?

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 馃檭

@SkafteNicki SkafteNicki added the bug / fix Something isn't working label Jun 6, 2022
@SkafteNicki SkafteNicki added this to the v0.10 milestone Jun 6, 2022
@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #1070 (7566fd9) into master (f0279bb) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #1070   +/-   ##
======================================
  Coverage      95%     95%           
======================================
  Files         181     181           
  Lines        8040    8046    +6     
======================================
+ Hits         7608    7614    +6     
  Misses        432     432           

@mergify mergify bot added the ready label Jun 6, 2022
@Borda Borda modified the milestones: v0.10, v0.9 Jun 7, 2022
torchmetrics/aggregation.py Outdated Show resolved Hide resolved
torchmetrics/aggregation.py Outdated Show resolved Hide resolved
torchmetrics/aggregation.py Outdated Show resolved Hide resolved
torchmetrics/aggregation.py Outdated Show resolved Hide resolved
Borda and others added 2 commits June 7, 2022 12:26
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
@Borda Borda enabled auto-merge (squash) June 7, 2022 10:26
@Borda Borda merged commit 1cc90c6 into master Jun 7, 2022
@Borda Borda deleted the bugfix/aggregation_zero_tensor branch June 7, 2022 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregation metrics ignore zeros tensors
3 participants