From: @lixiwen1 Reviewed-by: @xchu42 Signed-off-by:tags/v1.1.0
@@ -103,6 +103,12 @@ Status NetOutputPass::GetOutputNode(const ge::ComputeGraphPtr &graph, std::vecto | |||||
GELOGI("user set out node [%s] is found in user def targets, out node is prio!", ele.first->GetName().c_str()); | GELOGI("user set out node [%s] is found in user def targets, out node is prio!", ele.first->GetName().c_str()); | ||||
targets_.erase(iter); | targets_.erase(iter); | ||||
} | } | ||||
auto op_desc = ele.first->GetOpDesc(); | |||||
GE_CHECK_NOTNULL(op_desc); | |||||
if (op_desc->HasAttr(ATTR_ATC_USER_DEFINE_OUTPUT_NODES)) { | |||||
is_user_define_ouput_nodes = true; | |||||
} | |||||
output_nodes_info.push_back({ele.first, ele.second, -1}); | output_nodes_info.push_back({ele.first, ele.second, -1}); | ||||
} | } | ||||
GELOGI("Output node set by user or leaf node, size:%zu.", output_nodes_info.size()); | GELOGI("Output node set by user or leaf node, size:%zu.", output_nodes_info.size()); | ||||
@@ -414,7 +420,7 @@ Status NetOutputPass::ProcessWithNetoutput(const ge::ComputeGraphPtr &graph, con | |||||
Status NetOutputPass::AddCtrlEdgesBetweenLeafAndNetOutput(const ge::ComputeGraphPtr &graph, | Status NetOutputPass::AddCtrlEdgesBetweenLeafAndNetOutput(const ge::ComputeGraphPtr &graph, | ||||
const ge::NodePtr &net_out_node) { | const ge::NodePtr &net_out_node) { | ||||
GE_CHECK_NOTNULL(net_out_node); | GE_CHECK_NOTNULL(net_out_node); | ||||
if (!GetLocalOmgContext().user_out_nodes.empty()) { | |||||
if (!GetLocalOmgContext().user_out_nodes.empty() || is_user_define_ouput_nodes) { | |||||
GELOGI("No need to add ctrl edge to netoutput because user out nodes have been set."); | GELOGI("No need to add ctrl edge to netoutput because user out nodes have been set."); | ||||
return SUCCESS; | return SUCCESS; | ||||
} | } | ||||
@@ -220,6 +220,7 @@ class NetOutputPass : public GraphPass { | |||||
bool is_include_special_node_ = false; | bool is_include_special_node_ = false; | ||||
std::set<NodePtr> targets_; | std::set<NodePtr> targets_; | ||||
friend class ReUpdateNetOutputPass; | friend class ReUpdateNetOutputPass; | ||||
bool is_user_define_ouput_nodes = false; | |||||
}; | }; | ||||
} // namespace ge | } // namespace ge | ||||
#endif // GE_GRAPH_PASSES_NET_OUTPUT_PASS_H_ | #endif // GE_GRAPH_PASSES_NET_OUTPUT_PASS_H_ |
@@ -485,6 +485,10 @@ Status SetOutputNodeInfo(ge::Graph &graph, const std::string &output_type, const | |||||
GELOGE(domi::FAILED, "Check out node (%s) fail.", user_out_nodes[i].first.c_str()); | GELOGE(domi::FAILED, "Check out node (%s) fail.", user_out_nodes[i].first.c_str()); | ||||
return domi::FAILED; | return domi::FAILED; | ||||
} | } | ||||
// add user_define_output_nodes attr. | |||||
(void)ge::AttrUtils::SetStr(op_desc, ATTR_ATC_USER_DEFINE_OUTPUT_NODES, "true"); | |||||
if (i < output_formats.size()) { | if (i < output_formats.size()) { | ||||
if (output_formats[i] == domi::DOMI_TENSOR_NC1HWC0) { | if (output_formats[i] == domi::DOMI_TENSOR_NC1HWC0) { | ||||
GELOGI("The output node [%s] should be set NC1HWC0", user_out_nodes[i].first.c_str()); | GELOGI("The output node [%s] should be set NC1HWC0", user_out_nodes[i].first.c_str()); | ||||
@@ -1 +1 @@ | |||||
Subproject commit d090ec8335c091d7481675ed99c50e83c4dae853 | |||||
Subproject commit 37465b85d30b67a0edcc6ea4acd2f11a9697c7af |
@@ -1 +1 @@ | |||||
Subproject commit 0b7d8c9ffba6de83c4232db4f2e105ba51cd6296 | |||||
Subproject commit 5fa1f3ed9b1785b9fd1623d624de91838dff615e |