fix a sync stream problem in pynative mode

This commit is contained in:
lvchangquan 2020-08-11 20:30:44 +08:00
parent 21f234658a
commit 9fcba1ef36
1 changed files with 1 additions and 1 deletions

View File

@ -863,7 +863,7 @@ bool TensorNeedSync(const AnfNodePtr &parameter, const tensor::TensorPtr &tensor
auto ms_context = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(ms_context);
auto device_address = AnfAlgo::GetMutableOutputAddr(parameter, 0);
if (ms_context->execution_mode() == kPynativeMode) {
if (ms_context->enable_pynative_infer()) {
return tensor->device_address().get() == nullptr || tensor->device_address() != device_address;
}
if (tensor->is_dirty()) {