Skip to content

Resolve gh-1046 #2097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dpctl/tensor/_ctors.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ def _asarray_from_usm_ndarray(
raise TypeError(
f"Expected dpctl.tensor.usm_ndarray, got {type(usm_ndary)}"
)
if dtype is None:
dtype = usm_ndary.dtype
if usm_type is None:
usm_type = usm_ndary.usm_type
if sycl_queue is not None:
Expand All @@ -122,6 +120,8 @@ def _asarray_from_usm_ndarray(
copy_q = normalize_queue_device(sycl_queue=sycl_queue, device=exec_q)
else:
copy_q = usm_ndary.sycl_queue
if dtype is None:
dtype = _map_to_device_dtype(usm_ndary.dtype, copy_q)
# Conditions for zero copy:
can_zero_copy = copy is not True
# dtype is unchanged
Expand Down