Browse Source

Pre Merge pull request !92 from zhengyuanhua/development

pull/92/MERGE
zhengyuanhua Gitee 5 years ago
parent
commit
613ea1b8e3
8 changed files with 23 additions and 10 deletions
  1. +1
    -1
      metadef
  2. +1
    -0
      parser/CMakeLists.txt
  3. +1
    -0
      parser/common/CMakeLists.txt
  4. +1
    -1
      parser/common/module.mk
  5. +1
    -1
      parser/module.mk
  6. +1
    -0
      parser/onnx/CMakeLists.txt
  7. +1
    -1
      parser/onnx/module.mk
  8. +16
    -6
      parser/tensorflow/tensorflow_parser.cc

+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit c9b6960725036291ed2328f5751beb4f01247526
Subproject commit 4aabad33f2a0ba7380d4b0baf96712256dff53e7

+ 1
- 0
parser/CMakeLists.txt View File

@@ -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


+ 1
- 0
parser/common/CMakeLists.txt View File

@@ -32,6 +32,7 @@ add_library(parser_common SHARED ${SRC_LIST})

target_compile_options(parser_common PRIVATE
-Werror
-Wno-deprecated-declarations
)

target_compile_definitions(parser_common PRIVATE


+ 1
- 1
parser/common/module.mk View File

@@ -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


+ 1
- 1
parser/module.mk View File

@@ -58,7 +58,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


+ 1
- 0
parser/onnx/CMakeLists.txt View File

@@ -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


+ 1
- 1
parser/onnx/module.mk View File

@@ -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


+ 16
- 6
parser/tensorflow/tensorflow_parser.cc View File

@@ -234,11 +234,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::ParseSubgraphFuncV2 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(),
@@ -253,13 +259,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


Loading…
Cancel
Save