MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Interpret

Function Interpret

tensorflow/lite/testing/nnapi_example.cc:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37bool Interpret(const char* examples_filename, bool use_nnapi) {
38 std::ifstream tflite_stream(examples_filename);
39 if (!tflite_stream.is_open()) {
40 fprintf(stderr, "Can't open input file.");
41 return false;
42 }
43
44 printf("Use nnapi is set to: %d\n", use_nnapi);
45 tflite::testing::TfLiteDriver test_driver(
46 use_nnapi ? tflite::testing::TfLiteDriver::DelegateType::kNnapi
47 : tflite::testing::TfLiteDriver::DelegateType::kNone);
48
49 test_driver.SetModelBaseDir(dirname(examples_filename));
50 if (!tflite::testing::ParseAndRunTests(&tflite_stream, &test_driver)) {
51 fprintf(stderr, "Results from tflite don't match.");
52 return false;
53 }
54
55 return true;
56}
57
58int main(int argc, char* argv[]) {
59 bool use_nnapi = true;

Callers 1

mainFunction · 0.85

Calls 3

dirnameFunction · 0.85
ParseAndRunTestsFunction · 0.85
SetModelBaseDirMethod · 0.80

Tested by

no test coverage detected