aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEActivationLayerKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/NEON/kernels/NEActivationLayerKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEActivationLayerKernel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/NEON/kernels/NEActivationLayerKernel.cpp b/src/core/NEON/kernels/NEActivationLayerKernel.cpp
index 5251209463..a1652447f4 100644
--- a/src/core/NEON/kernels/NEActivationLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEActivationLayerKernel.cpp
@@ -533,17 +533,17 @@ typename std::enable_if<std::is_same<T, qasymm8_t>::value, void>::type NEActivat
if(act == ActivationFunction::RELU)
{
tmp = std::max(const_0, in);
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_t>(tmp * s + o);
}
else if(act == ActivationFunction::BOUNDED_RELU)
{
tmp = std::min(a, std::max(const_0, in));
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_t>(tmp * s + o);
}
else if(act == ActivationFunction::LU_BOUNDED_RELU)
{
tmp = std::min(a, std::max(b, in));
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_t>(tmp * s + o);
}
else if(act == ActivationFunction::LOGISTIC)
{
@@ -710,17 +710,17 @@ typename std::enable_if<std::is_same<T, qasymm8_signed_t>::value, void>::type NE
if(act == ActivationFunction::RELU)
{
tmp = std::max(const_0, in);
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_signed_t>(tmp * s + o);
}
else if(act == ActivationFunction::BOUNDED_RELU)
{
tmp = std::min(a, std::max(const_0, in));
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_signed_t>(tmp * s + o);
}
else if(act == ActivationFunction::LU_BOUNDED_RELU)
{
tmp = std::min(a, std::max(b, in));
- tmp = std::max<int32_t>(0, std::min<int32_t>(tmp * s + o, 255));
+ tmp = utility::clamp<qasymm8_signed_t>(tmp * s + o);
}
else if(act == ActivationFunction::LOGISTIC)
{