未验证 提交 94249f5e 编写于 作者: Z zyfncg 提交者: GitHub

fix set_value (#43694)

上级 31cbf63e
...@@ -78,6 +78,9 @@ inline void CheckAndUpdateSliceAttrs(const DDim in_dims, ...@@ -78,6 +78,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.
先完成此消息的编辑!
想要评论请 注册