提交 63ef5814 编写于 作者: E eclipsess

add case in loader: dim[2] < 0

上级 69be64ea
......@@ -44,7 +44,12 @@ void Loader<Dtype, P>::InitMemoryFromProgram(
} else {
auto dim = var_desc->Tensor_desc().Dims();
PADDLE_MOBILE_ENFORCE(dim.size() > 0, "dim size is 0");
dim[0] = 1;
// dim[0] = 1;
for (auto &d : dim) {
if (d < 0) {
d *= -1;
}
}
auto tensor = var->GetMutable<LoDTensor>();
tensor->Resize(make_ddim(dim));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册