Browse Source

!110 external interface: string changes ascendstring

Merge pull request !110 from zhengyuanhua/development
pull/110/MERGE
i-robot Gitee 4 years ago
parent
commit
cf60b0c02d
3 changed files with 19 additions and 8 deletions
  1. +1
    -1
      metadef
  2. +2
    -0
      parser/CMakeLists.txt
  3. +16
    -7
      parser/tensorflow/tensorflow_parser.cc

+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 6bdf2e3011150b200fdcd2acd18b7186902534b6
Subproject commit 4839ad5e4666c5d126537208ff5d45df175d6ea8

+ 2
- 0
parser/CMakeLists.txt View File

@@ -54,6 +54,7 @@ target_compile_options(fmk_parser PRIVATE
target_compile_definitions(fmk_parser PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
google=ascend_private
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
)

target_include_directories(fmk_parser PRIVATE
@@ -138,6 +139,7 @@ target_compile_definitions(fmk_parser_stub PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
REUSE_MEMORY=1
FMK_HOST_INFER
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC>
)

target_include_directories(fmk_parser_stub PRIVATE


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

@@ -233,12 +233,17 @@ Status PostOpProcessForSubgraph(const ParseArg &arg) {
if (arg.parent_node == nullptr) {
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_func_v2 = 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_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;
}
}

GELOGD("Post process for subgraph %s node %s type %s subgraph name %s", arg.function_name.c_str(),
@@ -253,13 +258,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_func_v2 != nullptr) {
ret = parse_func_v2(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