anko-intel commented on a change in pull request #20624:
URL: https://github.com/apache/incubator-mxnet/pull/20624#discussion_r831052142



##########
File path: src/ndarray/ndarray.cc
##########
@@ -211,18 +213,19 @@ nnvm::Symbol NDArray::get_autograd_symbol() const {
 
 #if MXNET_USE_ONEDNN == 1
 
-NDArray::NDArray(const dnnl::memory::desc& md)
-    : storage_type_(kDefaultStorage), autograd_entry_(nullptr) {
-  shape_ = mxnet::TShape(md.data.dims, md.data.dims + md.data.ndims);
-  dtype_ = get_mxnet_type(md.data.data_type);
-  ptr_   = std::make_shared<Chunk>(shape_, Context::CPU(), true, dtype_);
+NDArray::NDArray(const void* md_desc) : storage_type_(kDefaultStorage), 
autograd_entry_(nullptr) {
+  dnnl::memory::desc md = *static_cast<const dnnl::memory::desc*>(md_desc);
+  shape_                = mxnet::TShape(md.data.dims, md.data.dims + 
md.data.ndims);
+  dtype_                = get_mxnet_type(md.data.data_type);
+  ptr_                  = std::make_shared<Chunk>(shape_, Context::CPU(), 
true, dtype_);
   ptr_->CheckAndAlloc(md.get_size());
   ptr_->dnnl_mem_ = std::make_shared<DNNLMemory>(md, ptr_->shandle.dptr);
 }
 
-NDArray::NDArray(const std::shared_ptr<dnnl::memory>& dnnl_mem)
+NDArray::NDArray(const std::shared_ptr<dnnl::memory>& dnnl_mem_ptr)
     : storage_type_(kDefaultStorage), autograd_entry_(nullptr) {
-  auto mem_desc      = dnnl_mem->get_desc();
+  std::shared_ptr<dnnl::memory> dnnl_mem = 
std::static_pointer_cast<dnnl::memory>(dnnl_mem_ptr);

Review comment:
       conversion is not required




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to