diff --git a/mindspore/ccsrc/session/session_basic.cc b/mindspore/ccsrc/session/session_basic.cc index d11446a8ba0..1d7e8da5b0c 100644 --- a/mindspore/ccsrc/session/session_basic.cc +++ b/mindspore/ccsrc/session/session_basic.cc @@ -686,7 +686,7 @@ void SessionBasic::LoadInputData(const std::shared_ptr &kernel_grap } } if (need_sync) { - if (AnfAlgo::IsParameterWeight(pk_node)) { + if (ms_context->execution_mode() == kPynativeMode || AnfAlgo::IsParameterWeight(pk_node)) { tensor->set_device_address(device_address); } MS_EXCEPTION_IF_NULL(device_address);