if parameter is the second input of control depend and depend mode is 0,this control relation is invalid

This commit is contained in:
chenfei 2020-06-29 17:17:51 +08:00
parent 2daa1b33c2
commit 92aaf297c4
1 changed files with 2 additions and 2 deletions

View File

@ -548,8 +548,8 @@ void KernelGraph::UpdateControlDependRelations(const std::vector<AnfNodePtr> &de
if (prior_node->isa<Parameter>() && depend_mode == 1) {
prior_nodes = GetOutputNodes(prior_node);
}
if (depend_node->isa<Parameter>() && depend_mode == 1) {
depend_nodes = GetOutputNodes(depend_node);
if (depend_node->isa<Parameter>()) {
depend_nodes = depend_mode == 1 ? GetOutputNodes(depend_node) : std::vector<AnfNodePtr>();
}
for (auto &first_node : prior_nodes) {
if (AnfAlgo::CheckPrimitiveType(first_node, prim::kPrimControlDepend)) {