From f298e5507229e5463719c7d9d4b5055d48d137f9 Mon Sep 17 00:00:00 2001 From: lvchangquan Date: Thu, 30 Jul 2020 16:36:58 +0800 Subject: [PATCH] block use trans data to change format --- mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc index 026195cc29..1818e5ced5 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc @@ -484,7 +484,8 @@ bool AscendDeviceAddress::SyncDeviceToHostAndConvertFormat(const std::vector device_shape = GetDeviceShape(&host_shape); auto ms_context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(ms_context); - if (ms_context->execution_mode() == kPynativeMode && type_id_name_map.find(type_id_) != type_id_name_map.end()) { + if (ms_context->execution_mode() != kPynativeMode && ms_context->execution_mode() != kGraphMode && + type_id_name_map.find(type_id_) != type_id_name_map.end()) { std::pair type_format = std::make_pair(type_id_name_map.at(type_id_), format_); if (use_trans_data.find(type_format) != use_trans_data.end()) { sync_ok = SyncDeviceToHostAndConvertFormatBasedOnTransData(host_shape, device_shape, size, type, host_ptr);