!1966 fix load input data repeatedly in PyNative mode

Merge pull request !1966 from chujinjin/fix_loadinputdata_for_pynative
This commit is contained in:
mindspore-ci-bot 2020-06-11 14:43:17 +08:00 committed by Gitee
commit 68d760d5d3
1 changed files with 1 additions and 1 deletions

View File

@ -686,7 +686,7 @@ void SessionBasic::LoadInputData(const std::shared_ptr<KernelGraph> &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);