Skip to content

Commit f032717

Browse files
liym27frankwhzhang
authored andcommitted
Fix op test (PaddlePaddle#32231)
1 parent a5e35e2 commit f032717

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python/paddle/fluid/tests/unittests/op_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,8 @@ def check_grad_with_place(self,
14521452
# FIXME: Replace numeric_place with place to calculate numeric_grads.
14531453
# NOTE(liym27): There is an unknown error when call op.run() on NPUPlace, which
14541454
# needs to be fixed.
1455-
if self.__class__.use_npu == True:
1455+
if hasattr(self.__class__,
1456+
"use_npu") and self.__class__.use_npu == True:
14561457
numeric_place = paddle.CPUPlace()
14571458
else:
14581459
numeric_place = place

0 commit comments

Comments
 (0)