Skip to content

Commit 848da90

Browse files
Closes gh-1334
A non-empty array which is effectively 1D (only one dimension has size greater than one) should be marked as both C- and F- contiguous.
1 parent 369eda4 commit 848da90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dpctl/tensor/_stride_utils.pxi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,13 @@ cdef int _from_input_shape_strides(
181181
)
182182
i = j
183183
else:
184-
strides_inspected = 1
184+
if not strides_inspected:
185+
# all dimensions have size 1 except
186+
# dimension 'i'. Array is both C and F
187+
# contiguous
188+
strides_inspected = 1
189+
all_incr = (strides_arr[i] == 1)
190+
all_decr = all_incr
185191
break
186192
# should only set contig flags on actually obtained
187193
# values, rather than default values

0 commit comments

Comments
 (0)