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 2019/10/22 12:51:33 UTC

[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #16555: Upgrade MKL-DNN dependency to v1.0

samskalicky commented on a change in pull request #16555: Upgrade MKL-DNN dependency to v1.0
URL: https://github.com/apache/incubator-mxnet/pull/16555#discussion_r337484656
 
 

 ##########
 File path: src/ndarray/ndarray.cc
 ##########
 @@ -479,59 +474,52 @@ void NDArray::Chunk::SetMKLMem(const mxnet::TShape &shape, int dtype) {
 
   mkldnn::memory::dims dims;
   // These are shapes supprted by MKLDNN.
-  if (shape.ndim() >= 1 && shape.ndim() <= 5) {
+  if (shape.ndim() >= 1 && shape.ndim() <= 6) {
     dims.resize(shape.ndim());
     for (size_t i = 0; i < dims.size(); i++)
       dims[i] = shape[i];
   } else {
     LOG(FATAL) << "MKLDNN doesn't support " << shape.ndim() << " dimensions";
   }
-  mkldnn::memory::format layout = mkldnn::memory::format::format_undef;
+  mkldnn::memory::format_tag layout = mkldnn::memory::format_tag::undef;
   switch (dims.size()) {
-    case 1: layout = mkldnn::memory::format::x; break;
-    case 2: layout = mkldnn::memory::format::nc; break;
-    case 3: layout = mkldnn::memory::format::ncw; break;
-    case 4: layout = mkldnn::memory::format::nchw; break;
-    // This isn't the right layout when the data has 5 dimensions in MXNet.
-    // MXNet interprets 5 dimensions as ncdhw, but MKLDNN doesn't have
-    // a corresponding format.
-    case 5: layout = mkldnn::memory::format::goihw; break;
+    case 1: layout = mkldnn::memory::format_tag::a; break;
+    case 2: layout = mkldnn::memory::format_tag::ab; break;
+    case 3: layout = mkldnn::memory::format_tag::abc; break;
+    case 4: layout = mkldnn::memory::format_tag::abcd; break;
+    case 5: layout = mkldnn::memory::format_tag::abcde; break;
+    case 6: layout = mkldnn::memory::format_tag::abcdef; break;
 
 Review comment:
   can we use a more descriptive name here than abc, abcd, etc.?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services