mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
More descriptive error message for torch.nanmean() with complex dtypes (#153252)
Fixes #153132 Pull Request resolved: https://github.com/pytorch/pytorch/pull/153252 Approved by: https://github.com/colesbury
This commit is contained in:
committed by
PyTorch MergeBot
parent
b6868f290e
commit
21e42c5d62
@ -1792,7 +1792,7 @@ class TestReductions(TestCase):
|
||||
@dtypes(*complex_types())
|
||||
def test_nansum_complex(self, device, dtype):
|
||||
x = torch.randn((3, 3, 3), device=device, dtype=dtype)
|
||||
with self.assertRaisesRegex(RuntimeError, "nansum does not support complex inputs"):
|
||||
with self.assertRaisesRegex(RuntimeError, "nansum on CPU does not support complex inputs"):
|
||||
torch.nansum(x)
|
||||
|
||||
@dtypes(*all_types_and(torch.half))
|
||||
|
Reference in New Issue
Block a user