|
|
|
@@ -605,7 +605,7 @@ void SessionBasic::GetNewCNodeInputs(const CNodePtr &cnode, KernelGraph *graph, |
|
|
|
MS_EXCEPTION_IF_NULL(other_graph_cnode); |
|
|
|
MS_EXCEPTION_IF_NULL(cnode_inputs); |
|
|
|
auto origin_inputs = cnode->inputs(); |
|
|
|
bool optimize_depend = IsPrimitiveCNode(cnode, prim::kPrimDepend) && origin_inputs.size() == 3; |
|
|
|
bool optimize_depend = IsPrimitiveCNode(cnode, prim::kPrimDepend) && origin_inputs.size() >= 3; |
|
|
|
bool optimize_control_depend = IsPrimitiveCNode(cnode, prim::kPrimControlDepend) && origin_inputs.size() == 3; |
|
|
|
// if has multiple depends,only select first depend as parameter |
|
|
|
for (size_t input_idx = 1; input_idx < origin_inputs.size(); input_idx++) { |
|
|
|
@@ -615,7 +615,7 @@ void SessionBasic::GetNewCNodeInputs(const CNodePtr &cnode, KernelGraph *graph, |
|
|
|
if (graph->GetBackendAnfByFrontAnf(anf) != nullptr) { |
|
|
|
cnode_inputs->emplace_back(graph->GetBackendAnfByFrontAnf(anf)); |
|
|
|
continue; |
|
|
|
} else if (optimize_depend && input_idx == kDependAttachNodeIndex) { |
|
|
|
} else if (optimize_depend && input_idx > 1) { |
|
|
|
cnode_inputs->push_back(NewValueNode(MakeValue(SizeToInt(input_idx)))); |
|
|
|
continue; |
|
|
|
} else if (other_graph_cnode->find(anf) != other_graph_cnode->end()) { |
|
|
|
|