From 4c92332d84409832a2928529561df9826a656473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=A1=E6=99=A8?= Date: Wed, 25 Nov 2020 15:36:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!105=20:?= =?UTF-8?q?=20external=20interface=20modify:=20string=20change=20to=20asce?= =?UTF-8?q?ndstring'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadef | 2 +- parser/CMakeLists.txt | 2 -- parser/tensorflow/tensorflow_parser.cc | 23 +++++++---------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/metadef b/metadef index a464149..6bdf2e3 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit a464149d95257e7514859b198444fb341dc40786 +Subproject commit 6bdf2e3011150b200fdcd2acd18b7186902534b6 diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index c58092e..35ce7fa 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -54,7 +54,6 @@ target_compile_options(fmk_parser PRIVATE target_compile_definitions(fmk_parser PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 google=ascend_private - $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(fmk_parser PRIVATE @@ -139,7 +138,6 @@ target_compile_definitions(fmk_parser_stub PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 REUSE_MEMORY=1 FMK_HOST_INFER - $<$:ONLY_COMPILE_OPEN_SRC> ) target_include_directories(fmk_parser_stub PRIVATE diff --git a/parser/tensorflow/tensorflow_parser.cc b/parser/tensorflow/tensorflow_parser.cc index 25f6734..bce0002 100644 --- a/parser/tensorflow/tensorflow_parser.cc +++ b/parser/tensorflow/tensorflow_parser.cc @@ -233,17 +233,12 @@ Status PostOpProcessForSubgraph(const ParseArg &arg) { if (arg.parent_node == nullptr) { return SUCCESS; } - std::string op_type = arg.parent_node->GetType(); - std::string op_name = arg.parent_node->GetName(); - domi::ParseSubgraphFuncV2 parse_func_v2 = nullptr; - auto post_func = domi::OpRegistry::Instance()->GetParseSubgraphPostFunc(op_type); + + auto post_func = domi::OpRegistry::Instance()->GetParseSubgraphPostFunc(arg.parent_node->GetType()); if (post_func == nullptr) { - GELOGW("The subgraph post func for node %s type %s is null", op_name.c_str(), op_type.c_str()); - if (domi::OpRegistry::Instance()->GetParseSubgraphPostFunc(op_type, parse_func_v2) != SUCCESS || - parse_func_v2 == nullptr) { - GELOGW("The subgraph post func v2 for node %s type %s is null", op_name.c_str(), op_type.c_str()); - return SUCCESS; - } + GELOGW("The subgraph post func for node %s type %s is null", arg.parent_node->GetName().c_str(), + arg.parent_node->GetType().c_str()); + return SUCCESS; } GELOGD("Post process for subgraph %s node %s type %s subgraph name %s", arg.function_name.c_str(), @@ -258,17 +253,13 @@ Status PostOpProcessForSubgraph(const ParseArg &arg) { } auto graph = ge::GraphUtils::CreateGraphFromComputeGraph(arg.graph); - Status ret = FAILED; - if (post_func != nullptr) { - ret = post_func(arg.subgraph_name, graph); - } else if (parse_func_v2 != nullptr) { - ret = parse_func_v2(arg.subgraph_name.c_str(), graph); - } + auto ret = post_func(arg.subgraph_name, graph); if (ret != SUCCESS) { GELOGE(FAILED, "Failed to post-process subgraph %s on node %s type %s subgraph name %s", arg.function_name.c_str(), arg.parent_node->GetName().c_str(), arg.parent_node->GetType().c_str(), arg.subgraph_name.c_str()); return FAILED; } + return SUCCESS; } } // namespace