Evaluates the model on the `input_data`.
(self, tflite_model, input_data)
| 42 | class TestModels(test_util.TensorFlowTestCase): |
| 43 | |
| 44 | def _evaluateTFLiteModel(self, tflite_model, input_data): |
| 45 | """Evaluates the model on the `input_data`.""" |
| 46 | interpreter = Interpreter(model_content=tflite_model) |
| 47 | interpreter.allocate_tensors() |
| 48 | |
| 49 | input_details = interpreter.get_input_details() |
| 50 | output_details = interpreter.get_output_details() |
| 51 | |
| 52 | for input_tensor, tensor_data in zip(input_details, input_data): |
| 53 | interpreter.set_tensor(input_tensor['index'], tensor_data.numpy()) |
| 54 | interpreter.invoke() |
| 55 | return interpreter.get_tensor(output_details[0]['index']) |
| 56 | |
| 57 | def _getSimpleVariableModel(self): |
| 58 | root = tracking.AutoTrackable() |
no test coverage detected