[neurun] Use correct scale for Softmax (#2433)
author김수진/동작제어Lab(SR)/Engineer/삼성전자 <sjsujin.kim@samsung.com>
Thu, 23 Aug 2018 06:31:19 +0000 (15:31 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 23 Aug 2018 06:31:19 +0000 (15:31 +0900)
This commit uses correct scale for Softmax likes #1728.

Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
runtimes/neurun/src/backend/acl_cl/StageGenerator.cc

index 723c32e..bb76009 100644 (file)
@@ -481,6 +481,9 @@ Stage StageGenerator::generate(const ::internal::tflite::op::Softmax::Node &node
 {
   const ::neurun::graph::operand::Index output_index{node.param().output_index};
   const ::neurun::graph::operand::Index input_index{node.param().input_index};
+  const ::neurun::graph::operand::Index scale_index{node.param().scale_index};
+
+  assert(_ctx.at(scale_index).shape().rank() == 0);
 
   struct Param
   {
@@ -493,8 +496,7 @@ Stage StageGenerator::generate(const ::internal::tflite::op::Softmax::Node &node
 
   param.output_index = output_index.asInt();
   param.input_index = input_index.asInt();
-  // TODO Set scale correctly
-  param.scale = 1.0f;
+  param.scale = _ctx.at(scale_index).asScalar<float>();
 
   auto tensors = _tensor_builder;