Skip to content

Commit 5e6d5ba

Browse files
committed
_resolve_weak_types_all_py_ints only range-checks for integers
1 parent 0a078ff commit 5e6d5ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dpctl/tensor/_type_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ def _resolve_weak_types_all_py_ints(o1_dtype, o2_dtype, dev):
415415
)
416416
return _to_device_supported_dtype(dpt.float64, dev), o2_dtype
417417
else:
418-
if isinstance(o1_dtype, WeakIntegralType):
418+
if o1_kind_num == o2_kind_num and isinstance(
419+
o1_dtype, WeakIntegralType
420+
):
419421
o1_val = o1_dtype.get()
420422
o2_iinfo = dpt.iinfo(o2_dtype)
421423
if (o1_val < o2_iinfo.min) or (o1_val > o2_iinfo.max):
@@ -436,7 +438,9 @@ def _resolve_weak_types_all_py_ints(o1_dtype, o2_dtype, dev):
436438
_to_device_supported_dtype(dpt.float64, dev),
437439
)
438440
else:
439-
if isinstance(o2_dtype, WeakIntegralType):
441+
if o1_kind_num == o2_kind_num and isinstance(
442+
o2_dtype, WeakIntegralType
443+
):
440444
o2_val = o2_dtype.get()
441445
o1_iinfo = dpt.iinfo(o1_dtype)
442446
if (o2_val < o1_iinfo.min) or (o2_val > o1_iinfo.max):

0 commit comments

Comments
 (0)