From 7ec5ab95efc745742a6ac78230418c4aec2474fb Mon Sep 17 00:00:00 2001 From: dongduo Date: Tue, 17 Nov 2020 10:41:47 +0800 Subject: [PATCH] Fix aclgrphInferShapeAndType --- ge/ir_build/ge_ir_build.cc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index 3ff06d7a..ccf3b24e 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -131,6 +131,16 @@ static void GetOpsProtoPath(string &opsproto_path) { opsproto_path = (path_base + "ops/op_proto/custom/" + ":") + (path_base + "ops/op_proto/built-in/"); } +static void LoadOpsProto() { + string opsproto_path; + GetOpsProtoPath(opsproto_path); + GELOGI("Get opsproto path is %s", opsproto_path.c_str()); + OpsProtoManager *manager = OpsProtoManager::Instance(); + map option_tmp; + option_tmp.emplace(std::pair(string("ge.opsProtoLibPath"), opsproto_path)); + (void)manager->Initialize(option_tmp); +} + graphStatus aclgrphBuildInitialize(std::map global_options) { GELOGD("Enter aclgrphInitialize start!"); // check global options @@ -142,8 +152,7 @@ graphStatus aclgrphBuildInitialize(std::map global_opt // print global option map ge::PrintOptionMap(global_options, "global option"); - Impl builder; - builder.LoadOpsProto(); + LoadOpsProto(); std::shared_ptr instance_ptr = ge::GELib::GetInstance(); if (instance_ptr == nullptr || !instance_ptr->InitFlag()) { @@ -198,7 +207,7 @@ class Impl { bool is_dynamic_input); void SetRtSocVersion(); void UpdateThreadContext(); - void LoadOpsProto();s + void LoadOpsProto(); public: ge::GeGenerator generator_; std::map options_; @@ -340,16 +349,6 @@ void Impl::UpdateThreadContext() { GetThreadLocalContext().SetGraphOption(options_); } -void Impl::LoadOpsProto() { - string opsproto_path; - GetOpsProtoPath(opsproto_path); - GELOGI("Get opsproto path is %s", opsproto_path.c_str()); - OpsProtoManager *manager = OpsProtoManager::Instance(); - map option_tmp; - option_tmp.emplace(std::pair(string("ge.opsProtoLibPath"), opsproto_path)); - (void)manager->Initialize(option_tmp); -} - graphStatus Impl::CreateInputsForIRBuild(const ge::Graph &graph, vector &inputs) { auto compute_graph = ge::GraphUtils::GetComputeGraph(graph); GE_CHECK_NOTNULL(compute_graph);