We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5e35e2 commit f032717Copy full SHA for f032717
1 file changed
python/paddle/fluid/tests/unittests/op_test.py
@@ -1452,7 +1452,8 @@ def check_grad_with_place(self,
1452
# FIXME: Replace numeric_place with place to calculate numeric_grads.
1453
# NOTE(liym27): There is an unknown error when call op.run() on NPUPlace, which
1454
# needs to be fixed.
1455
- if self.__class__.use_npu == True:
+ if hasattr(self.__class__,
1456
+ "use_npu") and self.__class__.use_npu == True:
1457
numeric_place = paddle.CPUPlace()
1458
else:
1459
numeric_place = place
0 commit comments