Skip to content

Commit

Permalink
fix set_value (#43694) (#43783)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyfncg authored Jun 23, 2022
1 parent 4aa0515 commit 9d12e70
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 @@ -77,6 +77,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 9d12e70

Please sign in to comment.