Skip to content

Commit

Permalink
增加错误捕获类型 (#66223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lans1ot authored Jul 22, 2024
1 parent 327672f commit 454e6d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/deprecated/legacy_test/test_clip_grad_norm_.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def TestRuntimeErrorStaticMode():
clip_grad_norm_(input_pd, max_norm=2, norm_type=float("inf"))
paddle.disable_static()

self.assertRaises(RuntimeError, TestRuntimeErrorStaticMode)
if paddle.framework.use_pir_api():
self.assertRaises(AttributeError, TestRuntimeErrorStaticMode)
else:
self.assertRaises(RuntimeError, TestRuntimeErrorStaticMode)


def run_test_equal(
Expand Down

0 comments on commit 454e6d9

Please sign in to comment.