!21069 fix event insertion bug

Merge pull request !21069 from hwjiaorui/fix-stream
This commit is contained in:
i-robot 2021-07-30 01:19:21 +00:00 committed by Gitee
commit 9a26dd36ab
1 changed files with 3 additions and 3 deletions

View File

@ -1641,11 +1641,11 @@ void AscendStreamAssign::InsertEventForIndependentParallel(const NotNull<KernelG
MS_LOG(DEBUG) << "Deal independent op[" << (*it)->DebugString() << "]";
CNodePtr send_cnode_ptr = CreateSendApplyKernel(graph_ptr, cur_event_id, AnfAlgo::GetStreamId(*it));
auto target = FindTargetOp(it, cnodes.end(), *(it - 1), false);
auto target = FindTargetOp(it + 1, cnodes.end(), *it, false);
if (target == cnodes.end()) {
it++;
MS_LOG(DEBUG) << "Independent node[" << (*(it - 1))->fullname_with_scope()
MS_LOG(DEBUG) << "Independent node[" << (*it)->fullname_with_scope()
<< "] can't find target for insert recv op, no insert send/recv";
it++;
continue;
}