提交 0507f7bc 编写于 作者: T tensor-tang

fix SEGV elementwise add at debug mode

上级 c6af7201
...@@ -80,6 +80,9 @@ inline framework::DDim trim_trailing_singular_dims( ...@@ -80,6 +80,9 @@ inline framework::DDim trim_trailing_singular_dims(
for (int i = 0; i < actual_dims_size; ++i) { for (int i = 0; i < actual_dims_size; ++i) {
trim_dims[i] = dims[i]; trim_dims[i] = dims[i];
} }
if (trim_dims.size() == 0) {
return framework::DDim(framework::make_dim());
}
framework::DDim actual_dims = framework::make_ddim(trim_dims); framework::DDim actual_dims = framework::make_ddim(trim_dims);
return actual_dims; return actual_dims;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册