diff --git a/src/operator/tensor/elemwise_binary_op_basic.cc b/src/operator/tensor/elemwise_binary_op_basic.cc index 884a1ddad217..339290df8bf9 100644 --- a/src/operator/tensor/elemwise_binary_op_basic.cc +++ b/src/operator/tensor/elemwise_binary_op_basic.cc @@ -76,6 +76,9 @@ static inline bool ElemwiseAddStorageType(const nnvm::NodeAttrs& attrs, MXNET_OPERATOR_REGISTER_BINARY(elemwise_add) .set_attr("FInferStorageType", ElemwiseAddStorageType) .set_attr("FCompute", ElemwiseBinaryOp::Compute) +#if MXNET_USE_MKLDNN == 1 +.set_attr("TIsMKLDNN", true) +#endif .set_attr("FComputeEx", ElemwiseAddEx) .set_attr("FResourceRequest", /* For Sparse CSR */ [](const NodeAttrs& attrs) { @@ -156,6 +159,7 @@ NNVM_REGISTER_OP(_backward_add) .set_attr("FResourceRequest", [](const NodeAttrs& n) { return std::vector{ResourceRequest::kTempSpace}; }) +.set_attr("TIsMKLDNN", true) #endif .set_attr("FCompute", ElemwiseBinaryOp::BackwardUseNone< cpu, mshadow_op::identity, mshadow_op::identity>) diff --git a/src/operator/tensor/matrix_op.cc b/src/operator/tensor/matrix_op.cc index ffdc228b2d64..77d9bf06e2d1 100644 --- a/src/operator/tensor/matrix_op.cc +++ b/src/operator/tensor/matrix_op.cc @@ -266,6 +266,7 @@ Example:: .set_attr("FCompute", UnaryOp::IdentityCompute) .set_attr("FComputeEx", FlattenEx) #if MXNET_USE_MKLDNN == 1 +.set_attr("TIsMKLDNN", true) .set_attr("FResourceRequest", [](const NodeAttrs& n) { return std::vector{ResourceRequest::kTempSpace}; })