From 9fe2aa164748ecdf65677f1556bf3a3f0cdf2456 Mon Sep 17 00:00:00 2001 From: limingqi107 Date: Thu, 22 Apr 2021 15:48:43 +0800 Subject: [PATCH] fix the device address set of same tensor --- mindspore/ccsrc/backend/session/gpu_session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/backend/session/gpu_session.cc b/mindspore/ccsrc/backend/session/gpu_session.cc index 904297749d..150fbf914a 100644 --- a/mindspore/ccsrc/backend/session/gpu_session.cc +++ b/mindspore/ccsrc/backend/session/gpu_session.cc @@ -475,7 +475,7 @@ void GPUSession::UpdateOutputTensors(const VectorRef *outputs, const auto &address = AnfAlgo::GetMutableOutputAddr(node, output_index); // The outputs may have the same tensor, so need skip when the tensor has been set to device address. if ((address == nullptr) || (address->GetPtr() == nullptr)) { - return; + continue; } tensor->set_device_address(address);