Pass initing weight and bias on compilation time if data is null (#2427)
author김용섭/동작제어Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Thu, 23 Aug 2018 05:17:49 +0000 (14:17 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 23 Aug 2018 05:17:49 +0000 (14:17 +0900)
Fc's weight and bias can be passed on execution time not only model time.

these generated tests can be fixed as workaround method.
- fully_connected_quant8_weights_as_inputs
- fully_connected_quant8_large_weights_as_inputs

This should be fixed structurally on neuron runtime.
Ref: https://github.sec.samsung.net/STAR/nnfw/issues/2319

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 3803d8f..02afc32 100644 (file)
@@ -2002,6 +2002,8 @@ void Planner::visit(const ::internal::tflite::op::FullyConnected::Node &node)
                                                    _ctx.at(bias_index).zeroPoint()));
 
   // Set initializer for weight
+  // Workaround for https://github.sec.samsung.net/STAR/nnfw/issues/2319
+  if (_ctx.at(weight_index).hasData())
   {
     auto weight_base = _ctx.at(weight_index).data().base();
     auto weight_size = _ctx.at(weight_index).data().size();
@@ -2077,6 +2079,8 @@ void Planner::visit(const ::internal::tflite::op::FullyConnected::Node &node)
   }
 
   // Set initializer for bias
+  // Workaround for https://github.sec.samsung.net/STAR/nnfw/issues/2319
+  if (_ctx.at(bias_index).hasData())
   {
     auto bias_base = _ctx.at(bias_index).data().base();
     auto bias_type = _ctx.at(bias_index).type();