1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 #include "absl/types/optional.h" 16 #include "tensorflow/lite/tools/evaluation/tasks/task_executor.h" 17 #include "tensorflow/lite/tools/logging.h" 18 19 // This could serve as the main function for all eval tools. main(int argc,char * argv[])20int main(int argc, char* argv[]) { 21 auto task_executor = tflite::evaluation::CreateTaskExecutor(); 22 if (task_executor == nullptr) { 23 TFLITE_LOG(ERROR) << "Could not create the task evaluation!"; 24 return EXIT_FAILURE; 25 } 26 const auto metrics = task_executor->Run(&argc, argv); 27 if (!metrics.has_value()) { 28 TFLITE_LOG(ERROR) << "Could not run the task evaluation!"; 29 return EXIT_FAILURE; 30 } 31 return EXIT_SUCCESS; 32 } 33