If inference fails - exit before printing results.
It was easy to miss error message and mistakenly assume that execution succeeded.
Signed-off-by: alexander <alexander.efremov@arm.com>
Change-Id: I3c7beb5afe97db5df486e12e3bfe0e8e27e382f8
diff --git a/source/use_case/ad/src/UseCaseHandler.cc b/source/use_case/ad/src/UseCaseHandler.cc
index 8f86966..e99821f 100644
--- a/source/use_case/ad/src/UseCaseHandler.cc
+++ b/source/use_case/ad/src/UseCaseHandler.cc
@@ -194,7 +194,9 @@
audioDataSlider.TotalStrides() + 1);
/* Run inference over this audio clip sliding window */
- arm::app::RunInference(model, profiler);
+ if (!RunInference(model, profiler)) {
+ return false;
+ }
/* Use the negative softmax score of the corresponding index as the outlier score */
std::vector<float> dequantOutput = Dequantize<int8_t>(outputTensor);