diff --git a/src/io.cpp b/src/io.cpp index d2aa9cd62a14f13a240f85a8240376d0d8a9312a..0b02073b5a8bf2601f2bacdb0e03fb36648a3b92 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -205,8 +205,13 @@ const framework::Program Loader::Load( var_desc->Type() != framework::VARTYPE_TYPE_FETCH_LIST) { // DLOG << "to load var "; LoadVar(var, *var_desc, dirname + "/" + var_desc->Name()); + } else { + auto dim = var_desc->Tensor_desc().Dims(); + PADDLE_MOBILE_ENFORCE(dim.size() > 0, "dim size is 0"); + dim[0] = 1; + auto tensor = var->GetMutable(); + tensor->Resize(framework::make_ddim(dim)); } - } else { // TODO(codeWorm): some. }