From d21136e12c5c6afd8dfe2f323b09e45b40138ffd 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..b7f3ac5b4b36 100644 --- a/src/c_api/c_api.cc +++ b/src/c_api/c_api.cc @@ -628,11 +628,10 @@ 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()) { *out_pdata = arr->data().dptr_;