Browse Source

!12444 [MS][LITE][Develop]fix return value for second build

From: @lx0095
Reviewed-by: @zhanghaibo5,@hangangqiang
Signed-off-by: @hangangqiang
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
ac133d080c
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      mindspore/lite/src/cxx_api/model/model_impl.cc

+ 4
- 4
mindspore/lite/src/cxx_api/model/model_impl.cc View File

@@ -35,6 +35,10 @@ using mindspore::lite::RET_OK;

Status ModelImpl::Build() {
MS_LOG(DEBUG) << "Start build model.";
if (session_ != nullptr) {
MS_LOG(DEBUG) << "Model has been already built.";
return kSuccess;
}
if (graph_cell_ == nullptr || graph_cell_->GetGraph() == nullptr || graph_cell_->GetGraph()->graph_data_ == nullptr) {
MS_LOG(ERROR) << "Graph cell is invalid.";
return kLiteNullptr;
@@ -48,10 +52,6 @@ Status ModelImpl::Build() {
MS_LOG(ERROR) << "Lite model has been freed.";
return kLiteError;
}
if (session_ != nullptr) {
MS_LOG(DEBUG) << "Model has been already built.";
return kSuccess;
}
if (context_ == nullptr) {
MS_LOG(ERROR) << "Invalid context.";
return kLiteNullptr;


Loading…
Cancel
Save