Browse Source

!5618 fix pynative tuple bug

Merge pull request !5618 from flywind/fix_pynative_tuple_bug
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
529e1a0a81
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mindspore/ccsrc/pipeline/pynative/pynative_execute.cc

+ 4
- 1
mindspore/ccsrc/pipeline/pynative/pynative_execute.cc View File

@@ -1151,10 +1151,13 @@ void PynativeExecutor::EndGraphInner(const py::object &cell, const py::object &o
auto cnode = curr_g_->NewCNode(args);
for (int i = 0; i < tuple_size; i++) {
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);
SetTupleOutput(tuple[i], cnode, std::vector<int>{i});
}
cnode->set_inputs(args);
set_obj_node_map(curr_g_, out_id, cnode);
} else {
MS_LOG(DEBUG) << "Set ValueNode as output for graph, out id: " << out_id;


Loading…
Cancel
Save