Update forward AD not supported error message

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75105

Approved by: https://github.com/albanD
This commit is contained in:
soulitzer
2022-04-02 09:51:18 -04:00
committed by PyTorch MergeBot
parent ad028e5e09
commit 631f035131
2 changed files with 10 additions and 8 deletions

View File

@ -148,7 +148,7 @@ class TestGradients(TestCase):
if op.supports_fwgrad_bwgrad:
self._check_helper(device, dtype, op, op.get_op(), "fwgrad_bwgrad")
else:
err_msg = r"Trying to use forward AD with .* that does not support it\."
err_msg = r"Trying to use forward AD with .* that does not support it"
hint_msg = ("Running forward-over-backward gradgrad for an OP that has does not support it did not "
"raise any error. If your op supports forward AD, you should set supports_fwgrad_bwgrad=True.")
with self.assertRaisesRegex(NotImplementedError, err_msg, msg=hint_msg):
@ -189,7 +189,7 @@ class TestGradients(TestCase):
if op.supports_forward_ad:
call_grad_test_helper()
else:
err_msg = r"Trying to use forward AD with .* that does not support it\."
err_msg = r"Trying to use forward AD with .* that does not support it"
hint_msg = ("Running forward AD for an OP that has does not support it did not "
"raise any error. If your op supports forward AD, you should set supports_forward_ad=True")
with self.assertRaisesRegex(NotImplementedError, err_msg, msg=hint_msg):