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/03/28 00:36:21 UTC

[GitHub] [incubator-mxnet] ZhennanQin commented on a change in pull request #14545: Optimize transpose operator with MKL-DNN

ZhennanQin commented on a change in pull request #14545: Optimize transpose operator with MKL-DNN
URL: https://github.com/apache/incubator-mxnet/pull/14545#discussion_r269821881
 
 

 ##########
 File path: src/operator/tensor/matrix_op.cc
 ##########
 @@ -339,6 +339,34 @@ Example::
   })
 .add_argument("data", "NDArray-or-Symbol", "Input array.");
 
+#if MXNET_USE_MKLDNN == 1
+static void TransposeComputeExCPU(const nnvm::NodeAttrs& attrs,
+                                  const OpContext& ctx,
+                                  const std::vector<NDArray>& inputs,
+                                  const std::vector<OpReqType>& req,
+                                  const std::vector<NDArray>& outputs) {
+  const TransposeParam& param = nnvm::get<TransposeParam>(attrs.parsed);
+
+  CHECK_EQ(inputs.size(), 1U);
+  CHECK_EQ(outputs.size(), 1U);
+  if (SupportMKLDNNTranspose(param, inputs[0])) {
 
 Review comment:
   How about move `CHECK_EQ(req, kWriteTo) << "Transpose does not support inplace";` here? Then we have opportunity to provide fallback support instead of crash.

----------------------------------------------------------------
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