-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Errors when 0-dim tensor of complex or bool type passed to aminmax. #128404
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/128404
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit 97af98b with merge base 92ca17d (): NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
looks fine but missing test case!
test/test_reductions.py
Outdated
if dtype is bool: | ||
torch.aminmax(torch.tensor(1, dtype=dtype, device=device), dim=0) | ||
else: | ||
torch.aminmax(torch.tensor(1, dtype=dtype, device=device), dim=0) |
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.
if dtype is bool: | |
torch.aminmax(torch.tensor(1, dtype=dtype, device=device), dim=0) | |
else: | |
torch.aminmax(torch.tensor(1, dtype=dtype, device=device), dim=0) | |
torch.aminmax(torch.tensor(1, dtype=dtype, device=device), dim=0) |
the if and else statements look identical
test/test_reductions.py
Outdated
@dtypes(*complex_types()) | ||
def test_invalid_0dim_aminmax(self, device, dtype): | ||
with self.assertRaisesRegex(RuntimeError, 'not implemented'): | ||
torch.aminmax(torch.tensor(True, dtype=dtype, device=device), dim=0) |
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.
torch.aminmax(torch.tensor(True, dtype=dtype, device=device), dim=0) | |
torch.aminmax(torch.tensor(1.0, dtype=dtype, device=device), dim=0) |
could we use a scalar that is not a bool since bool's not the intended target dtype here?
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.
merge only if CI passes
@pytorchbot rebase -b main |
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
…boolean types are used.
Successfully rebased |
a4b7d65
to
97af98b
Compare
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 jobs have failed, first few of them are: trunk / macos-py3-arm64-mps / test (mps, 1, 1, macos-m1-13), trunk / macos-py3-arm64-mps / test (mps, 1, 1, macos-m1-14) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -f "Tests that would have run already pass" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes #126742
Added errors for the case of 0-dim tensors of complex or bool types passed to aminmax.
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10