We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bdf206 commit 4b98e94Copy full SHA for 4b98e94
dpctl/tensor/_copy_utils.py
@@ -672,6 +672,10 @@ def astype(
672
f_contig = usm_ary.flags.f_contiguous
673
needs_copy = copy or not ary_dtype == target_dtype
674
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
679
needs_copy = (
680
c_contig and not f_contig and order not in ["A", "C"]
681
) or (not c_contig and f_contig and order not in ["A", "F"])
0 commit comments