Skip to content

Commit 10d4d09

Browse files
[cherry-pick]fix strided slice,test=develop (#5704)
1 parent 1582d81 commit 10d4d09

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lite/kernels/host/strided_slice_compute.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ void stride_slice(const T* input,
210210
for (size_t j = 0; j < out_dims.size(); j++) {
211211
int cur_id = index_id / dst_step[j];
212212
index_id = index_id % dst_step[j];
213-
src_id +=
214-
(cur_id + starts_indices[j] + strides_indices[j] - 1) * src_step[j];
213+
src_id += (cur_id * strides_indices[j] + starts_indices[j]) * src_step[j];
215214
}
216215
out[dst_id] = input[src_id];
217216
}

0 commit comments

Comments
 (0)