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

 ##########
 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:
   I'm afraid there is no way to fallback. The check is copied from the 
original implementation:
   
https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/matrix_op-inl.h#L311
   
   I will move the check to here and make the error happens on an early stage.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to