Skip to content

1 regression tests available device #3335#3403

Merged
vfdev-5 merged 39 commits intopytorch:masterfrom
BanzaiTokyo:1_regression_tests_available_device
May 5, 2025
Merged

1 regression tests available device #3335#3403
vfdev-5 merged 39 commits intopytorch:masterfrom
BanzaiTokyo:1_regression_tests_available_device

Conversation

@BanzaiTokyo
Copy link
Copy Markdown
Contributor

test_canberra_metric.py
test_fractional_absolute_error.py
test_fractional_bias.py
test_geometric_mean_absolute_error.py

…al_bias.py, test_geometric_mean_absolute_error.py
@github-actions github-actions bot added the module: metrics Metrics module label May 3, 2025
@BanzaiTokyo BanzaiTokyo marked this pull request as ready for review May 3, 2025 16:28
(torch.rand(size=(100, 1)), torch.rand(size=(100, 1)), 20),
]
return test_cases
np_sum = (2 * np.abs(np_y_pred - np_y) / (np.abs(np_y_pred) + np.abs(np_y))).sum()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's use torch everywhere such that we could also remove import numpy as np

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, but numpy is still used in _test_distrib_compute

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can do the same there: error = 2 * torch.abs(pred - ground_truth) / (torch.abs(pred) + torch.abs(ground_truth))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, but wouldn't it make more sense to do a separate PR to do a pass on distributed tests?

@vfdev-5 vfdev-5 added this pull request to the merge queue May 5, 2025
Merged via the queue into pytorch:master with commit 5607139 May 5, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants