Skip to content

Commit 95d05c7

Browse files
Silly typo behind slow copy
The following example used to be very slow ```python import dpctl.tensor as dpt X = dpt.usm_ndarray((1_000_000, 4), "d") Z1 = dpt.usm_ndarray((1_000, 4), "d") X[:1_000] = Z1 ``` due to missing return after early optimization call.
1 parent 15c9d82 commit 95d05c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dpctl/tensor/_copy_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def copy_same_dtype(dst, src):
181181
def copy_same_shape(dst, src):
182182
if src.dtype == dst.dtype:
183183
copy_same_dtype(dst, src)
184+
return
184185

185186
# check that memory regions do not overlap
186187
if has_memory_overlap(dst, src):

0 commit comments

Comments
 (0)