[dynamo] Support ndarray.dtype attribute access (#124490)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/124490
Approved by: https://github.com/lezcano
ghstack dependencies: #125717
This commit is contained in:
Andrew M. James
2024-06-04 17:56:39 +00:00
committed by PyTorch MergeBot
parent a9cc147fa1
commit 4adee71155
7 changed files with 46 additions and 29 deletions

View File

@ -121,9 +121,7 @@ class TestBinaryUfuncs(TestCase):
def _helper_reference_numerics(
expected, actual, msg, exact_dtype, equal_nan=True
):
if not torch.can_cast(
numpy_to_torch_dtype_dict[expected.dtype.type], dtype
):
if not torch.can_cast(numpy_to_torch_dtype_dict[expected.dtype], dtype):
exact_dtype = False
if dtype is torch.bfloat16 and expected.dtype == np.float32: