From 7bdcefaf5e7014ddac2e51153ed7492e87ae7e09 Mon Sep 17 00:00:00 2001 From: lichun Date: Wed, 16 Dec 2020 20:29:01 +0800 Subject: [PATCH] support load om through LoadRootModel --- ge/graph/load/new_model_manager/model_manager.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ge/graph/load/new_model_manager/model_manager.cc b/ge/graph/load/new_model_manager/model_manager.cc index b595ac39..d19ca643 100755 --- a/ge/graph/load/new_model_manager/model_manager.cc +++ b/ge/graph/load/new_model_manager/model_manager.cc @@ -1055,7 +1055,16 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model mmTimespec timespec = mmGetTickCount(); ModelHelper model_helper; - Status ret = model_helper.LoadModel(model); + Status ret = model_helper.LoadRootModel(model); + if (model_helper.GetModelType()) { + bool is_shape_unknown = false; + GE_CHK_STATUS_RET(model_helper.GetGeRootModel()->CheckIsUnknownShape(is_shape_unknown), + "CheckIsUnknownShape failed, model id:%u", + model_id); + if (is_shape_unknown || GetContext().GetHostExecFlag()) { + return DoLoadHybridModelOnline(model_id, model_helper.GetGeRootModel(), listener); + } + } if (ret != SUCCESS) { GELOGE(ret, "load model failed."); return ret;