Adds python ref consistency test, elementwise unary reference inputs, and formats test files

Per title.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76626
Approved by: https://github.com/ngimel
This commit is contained in:
Mike Ruberry
2022-05-01 22:42:46 +00:00
committed by PyTorch MergeBot
parent 33be4c94c0
commit f6bbecf8b5
12 changed files with 3333 additions and 1682 deletions

View File

@ -11,7 +11,7 @@ import random
from torch.testing import make_tensor
from torch.testing._internal.common_utils import (
TestCase, run_tests, suppress_warnings, gradcheck, gradgradcheck,
torch_to_numpy_dtype_dict,
numpy_to_torch_dtype_dict,
)
from torch.testing._internal.common_device_type import \
(instantiate_device_type_tests, onlyCPU, dtypes, onlyNativeDeviceTypes, skipMeta)
@ -130,7 +130,7 @@ class TestViewOps(TestCase):
@onlyNativeDeviceTypes
@dtypes(*all_types_and_complex_and(torch.half, torch.bool))
def test_view_dtype_new(self, device, dtype):
dtypes = torch_to_numpy_dtype_dict.copy()
dtypes = {value : key for (key, value) in numpy_to_torch_dtype_dict.items()}
del dtypes[torch.bool]
def generate_inputs():