mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Throw invalid_argument instead of RuntimeError when parameters exceed… (#158267)
Throw invalid_argument instead of RuntimeError when parameters exceed limits (for torch.int32 dtype) Fixes #157707 Pull Request resolved: https://github.com/pytorch/pytorch/pull/158267 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
21a95bdf7c
commit
f5cf05c983
@ -488,7 +488,7 @@ class TestNumPyInterop(TestCase):
|
||||
) # type: ignore[call-overload]
|
||||
else:
|
||||
self.assertRaisesRegex(
|
||||
RuntimeError,
|
||||
ValueError,
|
||||
"(Overflow|an integer is required)",
|
||||
lambda: torch.mean(torch.randn(1, 1), np.uint64(-1)),
|
||||
) # type: ignore[call-overload]
|
||||
|
Reference in New Issue
Block a user