|
|
@ -196,6 +196,10 @@ template <typename T>
|
|
|
|
using SwishMKLDNNFunctor =
|
|
|
|
using SwishMKLDNNFunctor =
|
|
|
|
MKLDNNActivationFunc<T, mkldnn::algorithm::eltwise_swish>;
|
|
|
|
MKLDNNActivationFunc<T, mkldnn::algorithm::eltwise_swish>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
|
|
|
using SigmoidMKLDNNFunctor =
|
|
|
|
|
|
|
|
MKLDNNActivationFunc<T, mkldnn::algorithm::eltwise_logistic>;
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
using TanhMKLDNNFunctor =
|
|
|
|
using TanhMKLDNNFunctor =
|
|
|
|
MKLDNNActivationFunc<T, mkldnn::algorithm::eltwise_tanh>;
|
|
|
|
MKLDNNActivationFunc<T, mkldnn::algorithm::eltwise_tanh>;
|
|
|
@ -216,6 +220,10 @@ template <typename T>
|
|
|
|
using SwishMKLDNNGradFunctor =
|
|
|
|
using SwishMKLDNNGradFunctor =
|
|
|
|
MKLDNNActivationGradFunc<T, mkldnn::algorithm::eltwise_swish>;
|
|
|
|
MKLDNNActivationGradFunc<T, mkldnn::algorithm::eltwise_swish>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
|
|
|
using SigmoidMKLDNNGradFunctor =
|
|
|
|
|
|
|
|
MKLDNNActivationGradFunc<T, mkldnn::algorithm::eltwise_logistic>;
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
using TanhMKLDNNGradFunctor =
|
|
|
|
using TanhMKLDNNGradFunctor =
|
|
|
|
MKLDNNActivationGradFunc<T, mkldnn::algorithm::eltwise_tanh>;
|
|
|
|
MKLDNNActivationGradFunc<T, mkldnn::algorithm::eltwise_tanh>;
|
|
|
@ -244,6 +252,7 @@ namespace ops = paddle::operators;
|
|
|
|
__macro(leaky_relu, ReluMKLDNNFunctor, ReluMKLDNNGradFunctor); \
|
|
|
|
__macro(leaky_relu, ReluMKLDNNFunctor, ReluMKLDNNGradFunctor); \
|
|
|
|
__macro(gelu, GeluMKLDNNFunctor, GeluMKLDNNGradFunctor); \
|
|
|
|
__macro(gelu, GeluMKLDNNFunctor, GeluMKLDNNGradFunctor); \
|
|
|
|
__macro(swish, SwishMKLDNNFunctor, SwishMKLDNNGradFunctor); \
|
|
|
|
__macro(swish, SwishMKLDNNFunctor, SwishMKLDNNGradFunctor); \
|
|
|
|
|
|
|
|
__macro(sigmoid, SigmoidMKLDNNFunctor, SigmoidMKLDNNGradFunctor); \
|
|
|
|
__macro(tanh, TanhMKLDNNFunctor, TanhMKLDNNGradFunctor); \
|
|
|
|
__macro(tanh, TanhMKLDNNFunctor, TanhMKLDNNGradFunctor); \
|
|
|
|
__macro(sqrt, SqrtMKLDNNFunctor, SqrtMKLDNNGradFunctor); \
|
|
|
|
__macro(sqrt, SqrtMKLDNNFunctor, SqrtMKLDNNGradFunctor); \
|
|
|
|
__macro(abs, AbsMKLDNNFunctor, AbsMKLDNNGradFunctor);
|
|
|
|
__macro(abs, AbsMKLDNNFunctor, AbsMKLDNNGradFunctor);
|
|
|
|