Fix benchmark to check for kTfLiteError in case of benchmarking a model which returns an abort code.

PiperOrigin-RevId: 357599200
Change-Id: I4deeb665912c12d164e405cc79f76512d95068be
This commit is contained in:
Nat Jeffries 2021-02-15 11:59:42 -08:00 committed by TensorFlower Gardener
parent 709cd78c09
commit 72ceff2e12
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,9 @@ cc_library(
hdrs = [
"micro_benchmark.h",
],
visibility = [
"//visibility:public",
],
deps = [
"//tensorflow/lite/micro:micro_error_reporter",
"//tensorflow/lite/micro:micro_framework",

View File

@ -43,7 +43,7 @@ class MicroBenchmarkRunner {
void RunSingleIteration() {
// Run the model on this input and make sure it succeeds.
TfLiteStatus invoke_status = interpreter_.Invoke();
if (invoke_status != kTfLiteOk) {
if (invoke_status == kTfLiteError) {
MicroPrintf("Invoke failed.");
}
}