fix node check bug in convert_tuple_output_to_maketuple pass

pull/584/head
laiyongqiang 5 years ago
parent 2cdb62629f
commit 313018015b

@ -68,9 +68,8 @@ const AnfNodePtr ConvertTupleOutputToMaketuple::Process(const FuncGraphPtr &func
if (AnfAlgo::GetCNodeName(cnode) == prim::kPrimTupleGetItem->name()) { if (AnfAlgo::GetCNodeName(cnode) == prim::kPrimTupleGetItem->name()) {
return nullptr; return nullptr;
} }
if (std::any_of(cnode->inputs().begin() + 1, cnode->inputs().end(), [](const AnfNodePtr &node) { if (std::any_of(cnode->inputs().begin() + 1, cnode->inputs().end(),
return AnfAlgo::IsTupleOutput(node) && AnfAlgo::GetCNodeName(node) != prim::kPrimMakeTuple->name(); [](const AnfNodePtr &node) { return AnfAlgo::IsRealKernel(node) && AnfAlgo::IsTupleOutput(node); })) {
})) {
return ConvertTupleInputToMakeTuple(func_graph, cnode); return ConvertTupleInputToMakeTuple(func_graph, cnode);
} }
return nullptr; return nullptr;

Loading…
Cancel
Save