Enable remaining helpers in OperationsUtils (#396)
author최형규/동작제어Lab(SR)/Senior Engineer/삼성전자 <hk0110.choi@samsung.com>
Wed, 4 Apr 2018 01:35:24 +0000 (10:35 +0900)
committer이성재/동작제어Lab(SR)/Principal Engineer/삼성전자 <sj925.lee@samsung.com>
Wed, 4 Apr 2018 01:35:24 +0000 (10:35 +0900)
- Enable remaining helpers using activation type in OperationsUtils

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
src/runtime/ref/nn/common/OperationsUtils.cpp

index 9c3df01..486cc7f 100644 (file)
 #include "Operations.h"
 #include "Utils.h"
 
+// TODO-NNRT In Android NN, ActivationFunctor.h is included from Utils.h through RNN.h
+//           Remove this when Utils.h includes RNN.h
+#include "ActivationFunctor.h"
+
 #include <cmath>
 
 // TODO-NNRT: There was no <limits> included in Android NN code. Remove this later if unnecessary
@@ -142,8 +146,6 @@ void CalculateActivationRangeUint8(int32_t activation,
         return zero_point + static_cast<int32_t>(std::round(f / scale));
     };
 
-// TODO-NNRT Enable below code when common/include/ActivationFunctor.h available
-#if 0 // REF-ANN
     if (activation == kActivationRelu) {
         *act_min = std::max(qmin, quantize(0.0));
         *act_max = qmax;
@@ -157,7 +159,6 @@ void CalculateActivationRangeUint8(int32_t activation,
         *act_min = qmin;
         *act_max = qmax;
     }
-#endif
 }
 
 int32_t CalculateInputRadius(int input_integer_bits, int input_left_shift) {