diff --git a/mindspore/ccsrc/session/ascend_session.cc b/mindspore/ccsrc/session/ascend_session.cc index c042e11ec5a32c98a2fe4da4feb9af296b32444e..9c92749e4b0ca473b9c516c44a0d4d876df6262b 100644 --- a/mindspore/ccsrc/session/ascend_session.cc +++ b/mindspore/ccsrc/session/ascend_session.cc @@ -293,6 +293,9 @@ static void RecurseToUpdateCallRealInput(NotNull graph, void InsertMakeTupleForEmptyGraph(NotNull graph) { auto return_node = graph->get_return(); MS_EXCEPTION_IF_NULL(return_node); + if (return_node->size() <= kReturnDataIndex) { + return; + } auto origin_output = return_node->input(kReturnDataIndex); MS_EXCEPTION_IF_NULL(origin_output); std::vector make_tuple_input{