!19218 fix npu run jammed

Merge pull request !19218 from zhaozhenlong/lite/issue/npu_art_transfer_segmt
This commit is contained in:
i-robot 2021-07-01 11:26:39 +00:00 committed by Gitee
commit 9cf8d4343a
1 changed files with 2 additions and 0 deletions

View File

@ -77,11 +77,13 @@ int NPUDelegate::Init() {
if (!npu_manager_->IsSupportNPU()) {
MS_LOG(DEBUG) << "Checking that npu is unsupported.";
free(npu_manager_);
npu_manager_ = nullptr;
return RET_NOT_SUPPORT;
}
pass_manager_ = new (std::nothrow) NPUPassManager();
if (pass_manager_ == nullptr) {
free(npu_manager_);
npu_manager_ = nullptr;
MS_LOG(ERROR) << "New npu pass manager failed.";
return RET_ERROR;
}