From 6afd18a4d8770d5a125f6f97f1760c965ea82f02 Mon Sep 17 00:00:00 2001 From: kswang Date: Thu, 24 Jun 2021 10:43:53 +0800 Subject: [PATCH] fix get outputaddress error --- mindspore/ccsrc/backend/session/session_basic.cc | 3 +++ 1 file changed, 3 insertions(+) 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);