Skip to content

Commit 4f0f1a3

Browse files
Correctly handle inputs which are all Python scalars (weak types)
If dtypes list is empty, populate it with first Python scalar from weak_dtypes list.
1 parent 9eb8f03 commit 4f0f1a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpctl/tensor/_type_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def result_type(*arrays_and_dtypes):
767767
target_dev = d
768768
inspected = True
769769

770+
if not dtypes and weak_dtypes:
771+
dtypes.append(weak_dtypes[0].get())
772+
770773
if not (has_fp16 and has_fp64):
771774
for dt in dtypes:
772775
if not _dtype_supported_by_device_impl(dt, has_fp16, has_fp64):

0 commit comments

Comments
 (0)