未验证 提交 9d12e70c 编写于 作者: Z zyfncg 提交者: GitHub

fix set_value (#43694) (#43783)

上级 4aa0515d
...@@ -77,6 +77,9 @@ inline void CheckAndUpdateSliceAttrs(const DDim in_dims, ...@@ -77,6 +77,9 @@ inline void CheckAndUpdateSliceAttrs(const DDim in_dims,
// dim_value-1 // dim_value-1
// "end is -1" means contain the 0-th element of this axis. // "end is -1" means contain the 0-th element of this axis.
start = std::min(start, dim_value - 1); start = std::min(start, dim_value - 1);
if (end < -1) {
end += dim_value;
}
end = std::max(end, static_cast<T>(-1)); end = std::max(end, static_cast<T>(-1));
PADDLE_ENFORCE_GE( PADDLE_ENFORCE_GE(
start, start,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册