Skip to content

Commit 1a61fe9

Browse files
Fixed a typo in _map_to_device_dtype pointed out by @antonwolf
Also additional small change of creating `dtc` atop the function definition and using it throughout.
1 parent 395f3bc commit 1a61fe9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dpctl/tensor/_ctors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ def _asarray_from_usm_ndarray(
196196

197197

198198
def _map_to_device_dtype(dt, q):
199-
if dt.char == "?" or np.issubdtype(dt, np.integer):
199+
dtc = dt.char
200+
if dtc == "?" or np.issubdtype(dt, np.integer):
200201
return dt
201202
d = q.sycl_device
202-
dtc = dt.char
203203
if np.issubdtype(dt, np.floating):
204204
if dtc == "f":
205205
return dt
206206
if dtc == "d" and d.has_aspect_fp64:
207207
return dt
208-
if dtc == "h" and d.has_aspect_fp16:
208+
if dtc == "e" and d.has_aspect_fp16:
209209
return dt
210210
return dpt.dtype("f4")
211211
if np.issubdtype(dt, np.complexfloating):

0 commit comments

Comments
 (0)