From e5adf069af8fe348bf2bbb69181bc92133253c83 Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Fri, 27 Sep 2019 07:01:11 +0800 Subject: [PATCH] Fix MXNDArrayGetData --- src/c_api/c_api.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc index 14ec59f53f72..1696bf572e4c 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -628,10 +628,9 @@ int MXNDArrayGetData(NDArrayHandle handle, API_BEGIN(); NDArray *arr = static_cast(handle); #if MXNET_USE_MKLDNN == 1 - NDArray temp = *arr; if (arr->IsMKLDNNData()) { - temp = arr->Reorder2Default(); - arr = &temp; + arr->Reorder2DefaultAsync(); + arr->WaitToRead(); } #endif if (!arr->is_none()) {