From a0febdcc0dd7468f17d0d6ba07d5c0da22745e10 Mon Sep 17 00:00:00 2001 From: iLeGend <824040212@qq.com> Date: Tue, 22 Aug 2023 08:07:16 -0700 Subject: [PATCH] add special condition for not raise when x.dtype is complex --- test/legacy_test/test_logical_op.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/legacy_test/test_logical_op.py b/test/legacy_test/test_logical_op.py index 9e18441d482fe..4764e95cc3c51 100755 --- a/test/legacy_test/test_logical_op.py +++ b/test/legacy_test/test_logical_op.py @@ -182,7 +182,9 @@ def check_type(op_str, x, y, binary_op): y = paddle.to_tensor(y) error_type = BaseException if binary_op: - if type_str_map['x'] != type_str_map['y']: + if type_str_map['x'] != type_str_map['y'] and type_str_map[ + 'x' + ] not in [np.complex64, np.complex128]: unit_test.assertRaises(error_type, op, x=x, y=y) if not in_dynamic_mode(): error_type = TypeError