Skip to content

Commit

Permalink
fix set_value (#43694)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyfncg committed Jun 21, 2022
1 parent 31cbf63 commit 94249f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions paddle/phi/kernels/funcs/slice_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ inline void CheckAndUpdateSliceAttrs(const DDim in_dims,
// dim_value-1
// "end is -1" means contain the 0-th element of this axis.
start = std::min(start, dim_value - 1);
if (end < -1) {
end += dim_value;
}
end = std::max(end, static_cast<T>(-1));
PADDLE_ENFORCE_GE(
start,
Expand Down

0 comments on commit 94249f5

Please sign in to comment.