Skip to content

Commit 4b98e94

Browse files
Add comment to the line changed in this PR
1 parent 8bdf206 commit 4b98e94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dpctl/tensor/_copy_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,10 @@ def astype(
672672
f_contig = usm_ary.flags.f_contiguous
673673
needs_copy = copy or not ary_dtype == target_dtype
674674
if not needs_copy and (order != "K"):
675+
# ensure that order="F" for C-contig input triggers copy,
676+
# and order="C" for F-contig input triggers copy too.
677+
# 1D arrays which are both C- and F- contig should not
678+
# force copying for neither order="F", nor order="C", see gh-1926
675679
needs_copy = (
676680
c_contig and not f_contig and order not in ["A", "C"]
677681
) or (not c_contig and f_contig and order not in ["A", "F"])

0 commit comments

Comments
 (0)