Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 6eadab3

Browse files
xinyu-intelpengzhao-intel
authored andcommitted
[mkldnn-v1.0]Minor fix for leakyrelu compile flag (#16519)
* change to MXNET_USE_MKLDNN == 100 * trigger
1 parent ac7792d commit 6eadab3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/operator/leaky_relu.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
*/
2626

2727
#include "./leaky_relu-inl.h"
28-
#if MXNET_USE_MKLDNN == 1
28+
#if MXNET_USE_MKLDNN == 100
2929
#include "./nn/mkldnn/mkldnn_base-inl.h"
3030
#include "./nn/mkldnn/mkldnn_ops-inl.h"
31-
#endif // MXNET_USE_MKLDNN == 1
31+
#endif // MXNET_USE_MKLDNN == 100
3232

3333
#include <nnvm/op_attr_types.h>
3434
namespace mxnet {
@@ -84,7 +84,7 @@ static bool LeakyReLUShape(const nnvm::NodeAttrs& attrs,
8484
return true;
8585
}
8686

87-
#if MXNET_USE_MKLDNN == 1
87+
#if MXNET_USE_MKLDNN == 100
8888
static void LeakyReLUComputeExCPU(const nnvm::NodeAttrs& attrs,
8989
const OpContext& ctx,
9090
const std::vector<NDArray>& inputs,
@@ -139,7 +139,7 @@ inline static bool BackwardLeakyReLUStorageType(const nnvm::NodeAttrs& attrs,
139139
return MKLDNNStorageType(attrs, dev_mask, SupportMKLDNNLeakyRelu(param),
140140
dispatch_mode, in_attrs, out_attrs);
141141
}
142-
#endif // MXNET_USE_MKLDNN == 1
142+
#endif // MXNET_USE_MKLDNN == 100
143143

144144
NNVM_REGISTER_OP(LeakyReLU)
145145
.describe(R"code(Applies Leaky rectified linear unit activation element-wise to the input.
@@ -169,7 +169,7 @@ The following modified ReLU Activation functions are supported:
169169
return param.act_type == leakyrelu::kRReLU ? 2 : 1;
170170
})
171171
.set_attr_parser(ParamParser<LeakyReLUParam>)
172-
#if MXNET_USE_MKLDNN == 1
172+
#if MXNET_USE_MKLDNN == 100
173173
.set_attr<FInferStorageType>("FInferStorageType", LeakyReLUStorageType)
174174
#endif
175175
.set_attr<nnvm::FListInputNames>("FListInputNames",
@@ -187,7 +187,7 @@ The following modified ReLU Activation functions are supported:
187187
.set_attr<mxnet::FInferShape>("FInferShape", LeakyReLUShape)
188188
.set_attr<nnvm::FInferType>("FInferType", LeakyReLUType)
189189
.set_attr<FCompute>("FCompute<cpu>", LeakyReLUCompute<cpu>)
190-
#if MXNET_USE_MKLDNN == 1
190+
#if MXNET_USE_MKLDNN == 100
191191
.set_attr<bool>("TIsMKLDNN", true)
192192
.set_attr<FComputeEx>("FComputeEx<cpu>", LeakyReLUComputeExCPU)
193193
#endif
@@ -211,7 +211,7 @@ NNVM_REGISTER_OP(_backward_LeakyReLU)
211211
return param.act_type == leakyrelu::kPReLU ? 2 : 1;
212212
})
213213
.set_attr<nnvm::TIsBackward>("TIsBackward", true)
214-
#if MXNET_USE_MKLDNN == 1
214+
#if MXNET_USE_MKLDNN == 100
215215
.set_attr<FInferStorageType>("FInferStorageType", BackwardLeakyReLUStorageType)
216216
#endif
217217
.set_attr<nnvm::FInplaceOption>("FInplaceOption", [](const NodeAttrs& attrs){
@@ -221,7 +221,7 @@ NNVM_REGISTER_OP(_backward_LeakyReLU)
221221
return std::vector<ResourceRequest>{ResourceRequest::kTempSpace};
222222
})
223223
.set_attr_parser(ParamParser<LeakyReLUParam>)
224-
#if MXNET_USE_MKLDNN == 1
224+
#if MXNET_USE_MKLDNN == 100
225225
.set_attr<bool>("TIsMKLDNN", true)
226226
.set_attr<FComputeEx>("FComputeEx<cpu>", LeakyReLUGradComputeExCPU)
227227
#endif

0 commit comments

Comments
 (0)