mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Updates assertEqual to require atol and rtol, removes positional atol (#38872)
Summary: This updates assertEqual and assertEqual-like functions to either require both or neither of atol and rtol be specified. This should improve clarity around handling precision in the test suite, and it allows us to remove the legacy positional atol argument from assertEqual. In addition, the "message" kwarg is replace with a kwarg-only "msg" argument whose name is consistent with unittest's assertEqual argument. In the future we could make "msg" an optional third positional argument to be more consistent with unittest's assertEqual, but requiring it be specified should be clear, and we can easily update the signature to make "msg" an optional positional argument in the future, too. Pull Request resolved: https://github.com/pytorch/pytorch/pull/38872 Differential Revision: D21740237 Pulled By: mruberry fbshipit-source-id: acbc027aa1d7877a49664d94db9a5fff91a07042
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9b95f757af
commit
13120bf677
@ -146,10 +146,10 @@ class TestCppExtensionJIT(common.TestCase):
|
||||
actual_arches = sorted(re.findall(r'sm_\d\d', output))
|
||||
expected_arches = ['sm_' + xx for xx in expected_values]
|
||||
self.assertEqual(actual_arches, expected_arches,
|
||||
message="Flags: {}, Actual: {}, Expected: {}\n"
|
||||
"Stderr: {}\nOutput: {}".format(
|
||||
flags, actual_arches, expected_arches,
|
||||
err, output))
|
||||
msg="Flags: {}, Actual: {}, Expected: {}\n"
|
||||
"Stderr: {}\nOutput: {}".format(
|
||||
flags, actual_arches, expected_arches,
|
||||
err, output))
|
||||
|
||||
temp_dir = tempfile.mkdtemp()
|
||||
old_envvar = os.environ.get('TORCH_CUDA_ARCH_LIST', None)
|
||||
|
Reference in New Issue
Block a user