25
25
*/
26
26
27
27
#include " ./leaky_relu-inl.h"
28
- #if MXNET_USE_MKLDNN == 1
28
+ #if MXNET_USE_MKLDNN == 100
29
29
#include " ./nn/mkldnn/mkldnn_base-inl.h"
30
30
#include " ./nn/mkldnn/mkldnn_ops-inl.h"
31
- #endif // MXNET_USE_MKLDNN == 1
31
+ #endif // MXNET_USE_MKLDNN == 100
32
32
33
33
#include < nnvm/op_attr_types.h>
34
34
namespace mxnet {
@@ -84,7 +84,7 @@ static bool LeakyReLUShape(const nnvm::NodeAttrs& attrs,
84
84
return true ;
85
85
}
86
86
87
- #if MXNET_USE_MKLDNN == 1
87
+ #if MXNET_USE_MKLDNN == 100
88
88
static void LeakyReLUComputeExCPU (const nnvm::NodeAttrs& attrs,
89
89
const OpContext& ctx,
90
90
const std::vector<NDArray>& inputs,
@@ -139,7 +139,7 @@ inline static bool BackwardLeakyReLUStorageType(const nnvm::NodeAttrs& attrs,
139
139
return MKLDNNStorageType (attrs, dev_mask, SupportMKLDNNLeakyRelu (param),
140
140
dispatch_mode, in_attrs, out_attrs);
141
141
}
142
- #endif // MXNET_USE_MKLDNN == 1
142
+ #endif // MXNET_USE_MKLDNN == 100
143
143
144
144
NNVM_REGISTER_OP (LeakyReLU)
145
145
.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:
169
169
return param.act_type == leakyrelu::kRReLU ? 2 : 1 ;
170
170
})
171
171
.set_attr_parser(ParamParser<LeakyReLUParam>)
172
- #if MXNET_USE_MKLDNN == 1
172
+ #if MXNET_USE_MKLDNN == 100
173
173
.set_attr<FInferStorageType>(" FInferStorageType" , LeakyReLUStorageType)
174
174
#endif
175
175
.set_attr<nnvm::FListInputNames>(" FListInputNames" ,
@@ -187,7 +187,7 @@ The following modified ReLU Activation functions are supported:
187
187
.set_attr<mxnet::FInferShape>(" FInferShape" , LeakyReLUShape)
188
188
.set_attr<nnvm::FInferType>(" FInferType" , LeakyReLUType)
189
189
.set_attr<FCompute>(" FCompute<cpu>" , LeakyReLUCompute<cpu>)
190
- #if MXNET_USE_MKLDNN == 1
190
+ #if MXNET_USE_MKLDNN == 100
191
191
.set_attr<bool >(" TIsMKLDNN" , true )
192
192
.set_attr<FComputeEx>(" FComputeEx<cpu>" , LeakyReLUComputeExCPU)
193
193
#endif
@@ -211,7 +211,7 @@ NNVM_REGISTER_OP(_backward_LeakyReLU)
211
211
return param.act_type == leakyrelu::kPReLU ? 2 : 1 ;
212
212
})
213
213
.set_attr<nnvm::TIsBackward>(" TIsBackward" , true )
214
- #if MXNET_USE_MKLDNN == 1
214
+ #if MXNET_USE_MKLDNN == 100
215
215
.set_attr<FInferStorageType>(" FInferStorageType" , BackwardLeakyReLUStorageType)
216
216
#endif
217
217
.set_attr<nnvm::FInplaceOption>(" FInplaceOption" , [](const NodeAttrs& attrs){
@@ -221,7 +221,7 @@ NNVM_REGISTER_OP(_backward_LeakyReLU)
221
221
return std::vector<ResourceRequest>{ResourceRequest::kTempSpace };
222
222
})
223
223
.set_attr_parser(ParamParser<LeakyReLUParam>)
224
- #if MXNET_USE_MKLDNN == 1
224
+ #if MXNET_USE_MKLDNN == 100
225
225
.set_attr<bool >(" TIsMKLDNN" , true )
226
226
.set_attr<FComputeEx>(" FComputeEx<cpu>" , LeakyReLUGradComputeExCPU)
227
227
#endif
0 commit comments