Skip initialization for kernel and bias if their data is null (#2327)
author김용섭/동작제어Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Fri, 17 Aug 2018 05:21:32 +0000 (14:21 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Fri, 17 Aug 2018 05:21:32 +0000 (14:21 +0900)
Skip initialization for kernel and bias if their data is null. This
situation happens when kernel's value is set at execution time.

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

index 1ebcd2b..0ce957f 100644 (file)
@@ -846,6 +846,8 @@ void Planner::visit(const ::internal::tflite::op::Conv2D::Explicit::Node &node)
                                                    _ctx.at(bias_index).zeroPoint()));
 
   // Set initializer for kernel
+  // Workaround for https://github.sec.samsung.net/STAR/nnfw/issues/2319
+  if (_ctx.at(ker_index).hasData())
   {
     auto ker_base = _ctx.at(ker_index).data().base();
     auto ker_size = _ctx.at(ker_index).data().size();
@@ -873,6 +875,8 @@ void Planner::visit(const ::internal::tflite::op::Conv2D::Explicit::Node &node)
   }
 
   // Set initializer for bias
+  // See above comment.
+  if (_ctx.at(bias_index).hasData())
   {
     auto bias_base = _ctx.at(bias_index).data().base();
     auto bias_type = _ctx.at(bias_index).type();