diff --git a/ge/graph/passes/net_output_pass.cc b/ge/graph/passes/net_output_pass.cc index e3f2b71a..679d34e9 100644 --- a/ge/graph/passes/net_output_pass.cc +++ b/ge/graph/passes/net_output_pass.cc @@ -26,6 +26,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/omg/omg_inner_types.h" +#include "framework/omg/parser/parser_inner_ctx.h" #include "graph/debug/ge_attr_define.h" #include "graph/common/local_context.h" #include "graph/passes/pass_utils.h" @@ -414,7 +415,7 @@ Status NetOutputPass::ProcessWithNetoutput(const ge::ComputeGraphPtr &graph, con Status NetOutputPass::AddCtrlEdgesBetweenLeafAndNetOutput(const ge::ComputeGraphPtr &graph, const ge::NodePtr &net_out_node) { GE_CHECK_NOTNULL(net_out_node); - if (!GetLocalOmgContext().user_out_nodes.empty()) { + if (!GetLocalOmgContext().user_out_nodes.empty() || !GetParserContext().user_out_nodes.empty()) { GELOGI("No need to add ctrl edge to netoutput because user out nodes have been set."); return SUCCESS; }