!1841 Fix auto parallel save checkpoint bug

Merge pull request !1841 from caifubi/auto-parallel-save-ckpt-bug
This commit is contained in:
mindspore-ci-bot 2020-06-04 22:05:43 +08:00 committed by Gitee
commit 06ee0296b8
1 changed files with 3 additions and 1 deletions

View File

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