diff --git a/mindspore/ccsrc/backend/session/session_basic.cc b/mindspore/ccsrc/backend/session/session_basic.cc index c4a9eb17539..334f9700cf3 100644 --- a/mindspore/ccsrc/backend/session/session_basic.cc +++ b/mindspore/ccsrc/backend/session/session_basic.cc @@ -1598,6 +1598,9 @@ void SessionBasic::UpdateOutputTensors(const VectorRef *outputs, if (iter != tensor_to_node.end()) { const auto &node = iter->second.first; const auto &output_index = iter->second.second; + if (!AnfAlgo::OutputAddrExist(node, output_index)) { + continue; + } const auto &address = AnfAlgo::GetMutableOutputAddr(node, output_index); tensor->set_device_address(address);