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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix concatenation of zero dim states #229

Merged
merged 5 commits into from
May 5, 2021
Merged

Fix concatenation of zero dim states #229

merged 5 commits into from
May 5, 2021

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented May 5, 2021

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?

What does this PR do?

Fixes #227
Makes sure that metrics that use list as state can take in 0 dim input and the concatenation still works.

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 May 5, 2021
@SkafteNicki SkafteNicki added this to the v0.4 milestone May 5, 2021
CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #229 (207af49) into master (b75beea) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #229   +/-   ##
=======================================
  Coverage   96.80%   96.80%           
=======================================
  Files         184      184           
  Lines        6004     6010    +6     
=======================================
+ Hits         5812     5818    +6     
  Misses        192      192           
Flag Coverage Δ
Linux 79.06% <100.00%> (+0.02%) ⬆️
Windows 79.06% <100.00%> (+0.02%) ⬆️
cpu 96.80% <100.00%> (+<0.01%) ⬆️
gpu 96.80% <ø> (+<0.01%) ⬆️
macOS 96.80% <100.00%> (+<0.01%) ⬆️
pytest 96.80% <100.00%> (+<0.01%) ⬆️
python3.6 95.74% <100.00%> (+<0.01%) ⬆️
python3.8 96.77% <100.00%> (+<0.01%) ⬆️
python3.9 96.67% <100.00%> (+<0.01%) ⬆️
torch1.3.1 95.74% <100.00%> (+<0.01%) ⬆️
torch1.4.0 95.87% <100.00%> (+<0.01%) ⬆️
torch1.8.1 96.67% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
torchmetrics/functional/regression/spearman.py 93.33% <100.00%> (+0.31%) ⬆️
torchmetrics/utilities/data.py 96.36% <100.00%> (+0.06%) ⬆️
__w/1/s/torchmetrics/utilities/enums.py
__w/1/s/torchmetrics/functional/regression/ssim.py
__w/1/s/torchmetrics/classification/roc.py
...1/s/torchmetrics/functional/classification/dice.py
__w/1/s/torchmetrics/functional/image_gradients.py
.../1/s/torchmetrics/functional/classification/roc.py
...trics/functional/regression/mean_relative_error.py
__w/1/s/torchmetrics/retrieval/retrieval_metric.py
... and 176 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b75beea...207af49. Read the comment docs.

torchmetrics/utilities/data.py Outdated Show resolved Hide resolved
@Borda Borda added the ready label May 5, 2021
@Borda Borda enabled auto-merge (squash) May 5, 2021 09:49
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

@Borda Borda merged commit 33864db into master May 5, 2021
@Borda Borda deleted the pearson_fix branch May 5, 2021 17:35
Borda pushed a commit that referenced this pull request May 10, 2021
* fix

* changelog

Co-authored-by: Jirka Borovec <[email protected]>
(cherry picked from commit 33864db)
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.

PearsonCorrcoef will break when single sample is passed at a time.
3 participants