From 94a4dda790f3d8b8d9e05417ccf45e3894bc566f Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 12 Jul 2021 10:23:04 +0100 Subject: [PATCH] Catch ValueError due to recent change to torch.testing.assert_close --- test/test_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_models.py b/test/test_models.py index ee4af8bef58..72ae68f5615 100644 --- a/test/test_models.py +++ b/test/test_models.py @@ -108,7 +108,7 @@ def get_export_import_copy(m): tol = 3e-4 try: torch.testing.assert_close(results, results_from_imported, atol=tol, rtol=tol) - except torch.testing._asserts.UsageError: + except ValueError: # custom check for the models that return named tuples: # we compare field by field while ignoring None as assert_close can't handle None for a, b in zip(results, results_from_imported):