Skip to content

Commit

Permalink
add special condition for not raise when x.dtype is complex
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyouzhi committed Aug 22, 2023
1 parent 21350ee commit a0febdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/legacy_test/test_logical_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0febdc

Please sign in to comment.