未验证 提交 d878f971 编写于 作者: C chentianyu03 提交者: GitHub

fix split stride_numel may be 0 (#42537)

上级 95a502a2
......@@ -134,7 +134,7 @@ inline void StridedMemcpyWithAxis0(
for (size_t i = 0; i < outputs->size(); ++i) {
auto out_stride = stride_numel(shape_refer[i]->dims());
auto out = outputs->at(i);
if (out != nullptr && out->initialized()) {
if (out != nullptr && out->initialized() && out->numel() > 0) {
StridedNumelCopyWithAxis<T>(dev_ctx, axis, out->data<T>(), out_stride,
input.data<T>() + input_offset, in_stride,
out_stride[axis]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册