Skip to content

Commit 0017a7d

Browse files
Removed provably unreachable branches in _resolve_weak_types
Since o1_dtype_kind_num > o2_dtype_kind_num, o1 can be not be weak boolean type, since it has the lowest kind number in the hierarchy.
1 parent 1d10f86 commit 0017a7d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

dpctl/tensor/_elementwise_common.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ def _resolve_weak_types(o1_dtype, o2_dtype, dev):
301301
o1_kind_num = _weak_type_num_kind(o1_dtype)
302302
o2_kind_num = _strong_dtype_num_kind(o2_dtype)
303303
if o1_kind_num > o2_kind_num:
304-
if isinstance(o1_dtype, WeakBooleanType):
305-
return dpt.bool, o2_dtype
306304
if isinstance(o1_dtype, WeakIntegralType):
307305
return dpt.int64, o2_dtype
308306
if isinstance(o1_dtype, WeakComplexType):
@@ -322,8 +320,6 @@ def _resolve_weak_types(o1_dtype, o2_dtype, dev):
322320
o1_kind_num = _strong_dtype_num_kind(o1_dtype)
323321
o2_kind_num = _weak_type_num_kind(o2_dtype)
324322
if o2_kind_num > o1_kind_num:
325-
if isinstance(o2_dtype, WeakBooleanType):
326-
return o1_dtype, dpt.bool
327323
if isinstance(o2_dtype, WeakIntegralType):
328324
return o1_dtype, dpt.int64
329325
if isinstance(o2_dtype, WeakComplexType):

0 commit comments

Comments
 (0)