[PureACL] NEON Softmax (#2380)
author윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Wed, 22 Aug 2018 01:32:08 +0000 (10:32 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Wed, 22 Aug 2018 01:32:08 +0000 (10:32 +0900)
This commit enables NEON Softmax operation.
Test passed: GeneratedTests.softmax_float_1 and 2, GeneratedTests.softmax_quant8_1 and 2.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 9f7615e..9da8d48 100644 (file)
@@ -24,6 +24,7 @@
 #include <arm_compute/runtime/CL/functions/CLFloor.h>
 
 #include <arm_compute/runtime/SubTensor.h>
+#include <arm_compute/runtime/NEON/functions/NESoftmaxLayer.h>
 #include <arm_compute/runtime/NEON/functions/NEArithmeticAddition.h>
 #include <arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h>
 #include <arm_compute/runtime/NEON/functions/NEPixelWiseMultiplication.h>
@@ -2335,7 +2336,13 @@ void Planner::visit(const ::internal::tflite::op::Softmax::Node &node)
       builder.append("Softmax", std::move(fn));
     }
     else
-      throw std::runtime_error("Not supported, yet");
+    {
+      auto fn = nnfw::make_unique<::arm_compute::NESoftmaxLayer>();
+
+      fn->configure(input_alloc, output_alloc, param.scale);
+
+      builder.append("Softmax", std::move(fn));
+    }
   };
 
   _builder.addStage(stage);