Skip to content

Commit 8d16de7

Browse files
author
Qingsheng Li
authored
[Cherry Pick]Fix bug in sequence_slice_op (#13622)
* Fix bug in sequence_slice_op test=release/1.0.0
1 parent f0af5e7 commit 8d16de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/fluid/operators/sequence_slice_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ class SequenceSliceOpKernel : public framework::OpKernel<T> {
7575
}
7676

7777
for (size_t i = 0; i < n; ++i) {
78-
PADDLE_ENFORCE_LT(0, offset_data[i],
78+
PADDLE_ENFORCE_LE(0, offset_data[i],
7979
"The offset[%d] must greater than zero.", i);
8080
PADDLE_ENFORCE_LT(0, length_data[i],
8181
"The length[%d] must greater than zero.", i);
82-
PADDLE_ENFORCE_LT(lod[0][i] + offset_data[i] + length_data[i],
82+
PADDLE_ENFORCE_LE(lod[0][i] + offset_data[i] + length_data[i],
8383
lod[0][i + 1], "The target tensor's length overflow.");
8484
}
8585

0 commit comments

Comments
 (0)