Unverified Commit 23b87603 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Catch ValueError due to recent change to torch.testing.assert_close (#4165)

parent 8541c214
......@@ -108,7 +108,7 @@ def _check_jit_scriptable(nn_module, args, unwrapper=None, skip=False):
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment