Skip to content

Commit 812d4bc

Browse files
fix: Fixed NDArray_Slice when slicing vectors
1 parent e9d8bcf commit 812d4bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/manipulation.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ NDArray_Slice(NDArray* array, NDArray** indexes, int num_indices, int return_vie
237237
}
238238
slice_shape[0] = (int)floorf(((float)stop - (float)start) / (float)step);
239239
slice_strides[0] = NDArray_STRIDES(array)[0];
240+
offset = start * NDArray_STRIDES(array)[0];
240241
slice = NDArray_FromNDArray(array, offset, slice_shape, slice_strides, &out_ndim);
241242
return slice;
242243
}

0 commit comments

Comments
 (0)