!47560 [MSLITE][Fix] fix helper bug

Merge pull request !47560 from 赵英灼/fix_helper
This commit is contained in:
i-robot 2023-01-06 01:44:55 +00:00 committed by Gitee
commit 6ee3f4e772
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 9 additions and 0 deletions

View File

@ -155,6 +155,15 @@ Status ModelImpl::Build(const std::string &model_path, ModelType model_type,
Status ModelImpl::ConvertGraphOnline(const FuncGraphPtr &func_graph, const std::shared_ptr<Context> &model_context) {
MS_ASSERT(func_graph != nullptr);
auto device_list = model_context->MutableDeviceInfo();
for (const auto &device_info : device_list) {
if (device_info == nullptr) {
continue;
}
if (device_info->GetDeviceType() == DeviceType::kAscend && device_info->GetProvider() == "ge") {
return kSuccess;
}
}
auto value = func_graph->get_attr(lite::kIsOptimized);
if (value != nullptr) {
if (GetValue<bool>(value)) {