Skip to content

Commit 33e4bf5

Browse files
add processing of strides in asnumpy func (#927)
1 parent 67a101c commit 33e4bf5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dpnp/dpnp_iface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def asnumpy(input, order='C'):
133133
134134
"""
135135
if config.__DPNP_OUTPUT_DPCTL__ and hasattr(input, "__sycl_usm_array_interface__"):
136-
return np_st.as_strided(input.usm_data.copy_to_host().view(input.dtype), shape=input.shape)
136+
strides = (x * input.itemsize for x in input.strides)
137+
return np_st.as_strided(input.usm_data.copy_to_host().view(input.dtype), shape=input.shape, strides=strides)
137138

138139
return numpy.asarray(input, order=order)
139140

0 commit comments

Comments
 (0)