| 26 | namespace testing { |
| 27 | |
| 28 | bool RunDiffTest(const DiffOptions& options, int num_invocations) { |
| 29 | std::stringstream tflite_stream; |
| 30 | if (!GenerateTestSpecFromTensorflowModel( |
| 31 | tflite_stream, options.tensorflow_model, options.tflite_model, |
| 32 | num_invocations, options.input_layer, options.input_layer_type, |
| 33 | options.input_layer_shape, options.output_layer)) { |
| 34 | return false; |
| 35 | } |
| 36 | TfLiteDriver tflite_driver(options.delegate); |
| 37 | tflite_driver.LoadModel(options.tflite_model); |
| 38 | return tflite::testing::ParseAndRunTests(&tflite_stream, &tflite_driver); |
| 39 | } |
| 40 | } // namespace testing |
| 41 | |
| 42 | } // namespace tflite |