We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a26cac1 commit 3ba1b21Copy full SHA for 3ba1b21
dpctl/tensor/_ctors.py
@@ -111,8 +111,6 @@ def _asarray_from_usm_ndarray(
111
raise TypeError(
112
f"Expected dpctl.tensor.usm_ndarray, got {type(usm_ndary)}"
113
)
114
- if dtype is None:
115
- dtype = usm_ndary.dtype
116
if usm_type is None:
117
usm_type = usm_ndary.usm_type
118
if sycl_queue is not None:
@@ -122,6 +120,8 @@ def _asarray_from_usm_ndarray(
122
120
copy_q = normalize_queue_device(sycl_queue=sycl_queue, device=exec_q)
123
121
else:
124
copy_q = usm_ndary.sycl_queue
+ if dtype is None:
+ dtype = _map_to_device_dtype(usm_ndary.dtype, copy_q)
125
# Conditions for zero copy:
126
can_zero_copy = copy is not True
127
# dtype is unchanged
0 commit comments