nnfw: Generated Test fix for reshape (#2262)
authorTANUJ TEKRIWAL/System SW /SRI-Bangalore/Engineer/삼성전자 <tanuj.tekri@samsung.com>
Tue, 21 Aug 2018 09:07:46 +0000 (14:37 +0530)
committer샤란/System SW /SRI-Bangalore/Staff Engineer/삼성전자 <sharan.allur@samsung.com>
Tue, 21 Aug 2018 09:07:46 +0000 (14:37 +0530)
It fixes two generated test case failure
-reshape_weights_as_inputs
-reshape_quant8_weights_as_inputs
This patch adds sanity check if Inputs is not set.

Signed-off-by: Tanuj Tekriwal <tanuj.tekri@samsung.com>
runtimes/pure_arm_compute/src/execution.cc

index 4e0a12e..a64b54a 100644 (file)
@@ -479,7 +479,13 @@ int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution *execution,
   {
     auto setter = [&](::arm_compute::ITensor &tensor) { execution->source(n).push(tensor); };
 
-    plan.operands().at(model.inputs.at(n)).access(setter);
+    // Some operand may not be defined at plan. Because some operands
+    // may be useless at ACL (ex. shape tensor for Reshape operator)
+    // So added a sanity check.
+    if (plan.operands().exist(model.inputs.at(n)))
+    {
+      plan.operands().at(model.inputs.at(n)).access(setter);
+    }
   }
 
   const auto &operations = execution->plan().operations();