diff --git a/test/deprecated/legacy_test/test_nn_sigmoid_op.py b/test/deprecated/legacy_test/test_nn_sigmoid_op.py index ed80a30a837bf..ddc744544e0c0 100644 --- a/test/deprecated/legacy_test/test_nn_sigmoid_op.py +++ b/test/deprecated/legacy_test/test_nn_sigmoid_op.py @@ -50,7 +50,12 @@ def check_static_api(self, place): exe = paddle.static.Executor(place) out = exe.run(main_program, feed={'x': self.x}, fetch_list=[y]) np.testing.assert_allclose(out[0], self.y, rtol=1e-05) - self.assertTrue(y.name.startswith("api_sigmoid")) + + if paddle.framework.in_pir_mode(): + y_name = y.get_defining_op().name() + self.assertTrue(y_name.startswith("pd_op.sigmoid")) + else: + self.assertTrue(y.name.startswith("api_sigmoid")) def check_dynamic_api(self, place): paddle.disable_static(place)