Return error for not finished model compile (#3897)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 7 Dec 2018 00:50:43 +0000 (09:50 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 7 Dec 2018 00:50:43 +0000 (09:50 +0900)
When NNAPI call try to compile model not finished, return BAD_STATE error

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/frontend/compilation.cc

index a135eda..9b0719f 100644 (file)
@@ -32,6 +32,11 @@ int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model,
     return ANEURALNETWORKS_UNEXPECTED_NULL;
   }
 
+  if (!model->isFinished())
+  {
+    return ANEURALNETWORKS_BAD_STATE;
+  }
+
   std::shared_ptr<neurun::graph::Graph> internal;
 
   model->release(internal);