diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index 75e2fa8..6419f74 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -48,6 +48,7 @@ add_library(fmk_parser SHARED ${SRC_LIST} ${PROTO_SRCS}) target_compile_options(fmk_parser PRIVATE -Werror + -Wno-deprecated-declarations ) target_compile_definitions(fmk_parser PRIVATE diff --git a/parser/common/CMakeLists.txt b/parser/common/CMakeLists.txt index f5e987b..1219f30 100644 --- a/parser/common/CMakeLists.txt +++ b/parser/common/CMakeLists.txt @@ -31,6 +31,7 @@ add_library(parser_common SHARED ${SRC_LIST}) target_compile_options(parser_common PRIVATE -Werror + -Wno-deprecated-declarations ) target_compile_definitions(parser_common PRIVATE diff --git a/parser/common/module.mk b/parser/common/module.mk index dad01b0..cf669c6 100644 --- a/parser/common/module.mk +++ b/parser/common/module.mk @@ -5,7 +5,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := libparser_common LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -LOCAL_CFLAGS += -Werror -Dgoogle=ascend_private +LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations -Dgoogle=ascend_private ifeq ($(DEBUG), 1) LOCAL_CFLAGS += -g -O0 endif diff --git a/parser/module.mk b/parser/module.mk index 2a09c8b..cdcbe4c 100644 --- a/parser/module.mk +++ b/parser/module.mk @@ -52,7 +52,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := libfmk_parser LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -LOCAL_CFLAGS += -Werror -Dgoogle=ascend_private +LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations -Dgoogle=ascend_private ifeq ($(DEBUG), 1) LOCAL_CFLAGS += -g -O0 endif diff --git a/parser/onnx/CMakeLists.txt b/parser/onnx/CMakeLists.txt index 99d2059..82dc484 100644 --- a/parser/onnx/CMakeLists.txt +++ b/parser/onnx/CMakeLists.txt @@ -18,6 +18,7 @@ add_library(fmk_onnx_parser SHARED ${SRC_LIST} ${PROTO_HDRS}) target_compile_options(fmk_onnx_parser PRIVATE -Werror + -Wno-deprecated-declarations ) target_compile_definitions(fmk_onnx_parser PRIVATE diff --git a/parser/onnx/module.mk b/parser/onnx/module.mk index 3710780..76964eb 100644 --- a/parser/onnx/module.mk +++ b/parser/onnx/module.mk @@ -6,7 +6,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := libfmk_onnx_parser LOCAL_CFLAGS += -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 -LOCAL_CFLAGS += -Werror -Dgoogle=ascend_private +LOCAL_CFLAGS += -Werror -Wno-deprecated-declarations -Dgoogle=ascend_private ifeq ($(DEBUG), 1) LOCAL_CFLAGS += -g -O0 endif diff --git a/parser/tensorflow/tensorflow_parser.cc b/parser/tensorflow/tensorflow_parser.cc index cdf727e..d9dcb1b 100644 --- a/parser/tensorflow/tensorflow_parser.cc +++ b/parser/tensorflow/tensorflow_parser.cc @@ -198,11 +198,17 @@ Status PostOpProcessForSubgraph(const ParseArg &arg) { return SUCCESS; } - auto post_func = domi::OpRegistry::Instance()->GetParseSubgraphPostFunc(arg.parent_node->GetType()); + std::string op_type = arg.parent_node->GetType(); + std::string op_name = arg.parent_node->GetName(); + domi::ParseSubgraphFuncV1 parse_subgraph = nullptr; + auto post_func = domi::OpRegistry::Instance()->GetParseSubgraphPostFunc(op_type); if (post_func == nullptr) { - 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; + 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_subgraph) != SUCCESS || + parse_subgraph == nullptr) { + GELOGW("The subgraph new post func for node[%s] type [%s] is null", op_name.c_str(), op_type.c_str()); + return SUCCESS; + } } GELOGD("Post process for subgraph %s node %s type %s subgraph name %s", arg.function_name.c_str(), @@ -217,13 +223,17 @@ Status PostOpProcessForSubgraph(const ParseArg &arg) { } auto graph = ge::GraphUtils::CreateGraphFromComputeGraph(arg.graph); - auto ret = post_func(arg.subgraph_name, graph); + Status ret = FAILED; + if (post_func != nullptr) { + ret = post_func(arg.subgraph_name, graph); + } else if (parse_subgraph != nullptr) { + ret = parse_subgraph(arg.subgraph_name.c_str(), 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