You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/07/21 11:42:46 UTC

[GitHub] [incubator-mxnet] sfraczek commented on a change in pull request #20349: Decouple OneDNN data structures in MXNet C++ API

sfraczek commented on a change in pull request #20349:
URL: https://github.com/apache/incubator-mxnet/pull/20349#discussion_r673795330



##########
File path: src/operator/nn/mkldnn/mkldnn_base.cc
##########
@@ -173,7 +176,8 @@ mkldnn_output_t CreateMKLDNNMem(const NDArray& out_arr,
     auto tmp = TmpMemMgr::Get()->Alloc(desc);
     return mkldnn_output_t(OutDataOp::AddBack, tmp);
   } else if (kWriteInplace == req && in_arr != nullptr && CanWriteTo(out_arr, *in_arr, desc)) {
-    mkldnn::memory* mem = const_cast<NDArray&>(out_arr).CreateMKLDNNData(desc);
+    mkldnn::memory* mem =
+        static_cast<mkldnn::memory*>(const_cast<NDArray&>(out_arr).CreateMKLDNNData(&desc));

Review comment:
       Consider using auto where static_cast already reveals the type.

##########
File path: src/operator/operator_common.h
##########
@@ -614,7 +613,8 @@ class OpSignature {
   void AddSign(const NDArray& arr) {
 #if MXNET_USE_MKLDNN == 1
     if (arr.IsMKLDNNData()) {
-      AddSign(*(arr.GetMKLDNNData()));
+      auto arr_data = static_cast<const mkldnn::memory*>(arr.GetMKLDNNData());
+      AddSign(*(arr_data));

Review comment:
       Consider removing this extra parenthesis.

##########
File path: src/operator/nn/concat.cc
##########
@@ -166,18 +168,17 @@ bool ConcatType(const nnvm::NodeAttrs& attrs,
     for (size_t i = 0; i < nin; ++i) {
       in_type->push_back(dtype);
     }
-  // if out types are known in types are unknown
+    // if out types are known in types are unknown

Review comment:
       Do you think there is a better place for this comment? To me it's clear it regards the next line but it's weird that it was auto indented.




-- 
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: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org