Skip to content

Commit 23fd986

Browse files
Corrected select statement for shift normalization
1 parent 10f5706 commit 23fd986

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/tensor/libtensor/source/copy_for_roll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ copy_usm_ndarray_for_roll_nd(const dpctl::tensor::usm_ndarray &src,
326326
// normalize shift parameter to be 0 <= offset < dim
327327
py::ssize_t dim = src_shape_ptr[i];
328328
size_t offset =
329-
(shifts[i] > 0) ? (shifts[i] % dim) : dim + (shifts[i] % dim);
329+
(shifts[i] >= 0) ? (shifts[i] % dim) : dim + (shifts[i] % dim);
330330

331331
normalized_shifts.push_back(offset);
332332
}

0 commit comments

Comments
 (0)