From 25878e62d90c7e97553d46e84f1c37c184733610 Mon Sep 17 00:00:00 2001 From: lvchangquan Date: Tue, 21 Jul 2020 19:59:00 +0800 Subject: [PATCH] fix conv2d precision problem and conv2d runtime error. --- .../ccsrc/runtime/device/ascend/ascend_device_address.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc index a4eb11adba..5ec96a7467 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc @@ -415,9 +415,9 @@ bool AscendDeviceAddress::SyncDeviceToHostAndConvertFormatBasedOnTransData(const MS_LOG(ERROR) << "Illegal dtype."; } auto shape_size = trans::ShapeSize(host_shape); - auto size_tmp = device_dtype_size * shape_size; - size = GetCommonAlignSize(size_tmp); + size = device_dtype_size * shape_size; } + size = GetCommonAlignSize(size); void *output_address_ptr = nullptr; auto ret_malloc = rtMalloc(&output_address_ptr, size, RT_MEMORY_HBM); if (ret_malloc != RT_ERROR_NONE) { @@ -427,7 +427,7 @@ bool AscendDeviceAddress::SyncDeviceToHostAndConvertFormatBasedOnTransData(const // launch LaunchTransData(kernel_mod_ptr, output_address_ptr, size, workspace_size_list); if (type_id_ == type) { - SyncMemory(host_ptr, output_address_ptr, size, RT_MEMCPY_DEVICE_TO_HOST); + SyncMemory(host_ptr, output_address_ptr, host_size, RT_MEMCPY_DEVICE_TO_HOST); } else { auto host = std::vector(size); SyncMemory(host.data(), output_address_ptr, size, RT_MEMCPY_DEVICE_TO_HOST);