!29337 Input_node address is not updated in data_prepare_actor if the the address is persistent.

Merge pull request !29337 from caifubi/master-fix-data-prepare-actor-bug
This commit is contained in:
i-robot 2022-01-21 06:21:13 +00:00 committed by Gitee
commit 9d20bce3b4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -674,7 +674,8 @@ void DataPrepareActor::PrepareDataForWeightNode(const AnfNodePtr &backend_node,
!(host_tensor_address->format() != device_tensor->format() && strategy_ == GraphExecutionStrategy::kStep)) {
// In the scenario of training + inference , the device address of the weight node can not be changed when
// multi-graphs sink mode is set.
if (device_tensor->is_ptr_persisted() && (host_tensor_address != device_tensor)) {
if (device_tensor->is_ptr_persisted() && (host_tensor_address != device_tensor) &&
strategy_ != GraphExecutionStrategy::kStep) {
if (!Copy(device_tensor.get(), host_tensor_address.get())) {
std::string error_info = "Sync data error.";
SET_OPCONTEXT_FAIL_RET_WITH_ERROR_BY_STRATEGY(real_strategy_, (*context), error_info);