From 88ac2ae514171c472b09fcdcdcab7dbd596d9984 Mon Sep 17 00:00:00 2001 From: caifubi Date: Thu, 4 Jun 2020 14:35:12 +0800 Subject: [PATCH] Only weight tensor need to bind with Parameter device_address --- mindspore/ccsrc/session/session_basic.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/session/session_basic.cc b/mindspore/ccsrc/session/session_basic.cc index d3befcefe..8955aaa67 100644 --- a/mindspore/ccsrc/session/session_basic.cc +++ b/mindspore/ccsrc/session/session_basic.cc @@ -676,7 +676,9 @@ void SessionBasic::LoadInputData(const std::shared_ptr &kernel_grap } } if (need_sync) { - tensor->set_device_address(device_address); + if (AnfAlgo::IsParameterWeight(pk_node)) { + tensor->set_device_address(device_address); + } MS_EXCEPTION_IF_NULL(device_address); if (!device_address->SyncHostToDevice(trans::GetRuntimePaddingShape(pk_node, 0), LongToSize(tensor->data().nbytes()), tensor->data_type(), -- GitLab