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