提交 0ed60257 编写于 作者: K kpy

fix tuple return bug

上级 469b132c
...@@ -1151,10 +1151,13 @@ void PynativeExecutor::EndGraphInner(const py::object &cell, const py::object &o ...@@ -1151,10 +1151,13 @@ void PynativeExecutor::EndGraphInner(const py::object &cell, const py::object &o
auto cnode = curr_g_->NewCNode(args); auto cnode = curr_g_->NewCNode(args);
for (int i = 0; i < tuple_size; i++) { for (int i = 0; i < tuple_size; i++) {
args.push_back(GetInput(tuple[i], false)); args.push_back(GetInput(tuple[i], false));
}
cnode->set_inputs(args);
for (int i = 0; i < tuple_size; i++) {
set_obj_node_map(curr_g_, GetId(tuple[i]), cnode, i); set_obj_node_map(curr_g_, GetId(tuple[i]), cnode, i);
SetTupleOutput(tuple[i], cnode, std::vector<int>{i}); SetTupleOutput(tuple[i], cnode, std::vector<int>{i});
} }
cnode->set_inputs(args);
set_obj_node_map(curr_g_, out_id, cnode); set_obj_node_map(curr_g_, out_id, cnode);
} else { } else {
MS_LOG(DEBUG) << "Set ValueNode as output for graph, out id: " << out_id; MS_LOG(DEBUG) << "Set ValueNode as output for graph, out id: " << out_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册