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

fix bug of strided_slice (#43388)

* fix stride_slice bug

* fix bug
上级 ee605673
...@@ -74,10 +74,14 @@ static void StridedSliceOutDims(const std::vector<int64_t>& starts, ...@@ -74,10 +74,14 @@ static void StridedSliceOutDims(const std::vector<int64_t>& starts,
if (start_index < 0) { if (start_index < 0) {
start_index = start_index + axis_size; start_index = start_index + axis_size;
start_index = std::max<int64_t>(start_index, 0);
} }
if (end_index < 0) { if (end_index < 0) {
if (!(end_index == -1 && stride_index < 0)) { // skip None stop condition if (!(end_index == -1 && stride_index < 0)) { // skip None stop condition
end_index = end_index + axis_size; end_index = end_index + axis_size;
if (end_index < 0) {
end_index = 0;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册