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

Method _evaluateTFLiteModel

tensorflow/lite/python/lite_v2_test.py:44–55  ·  view source on GitHub ↗

Evaluates the model on the `input_data`.

(self, tflite_model, input_data)

Source from the content-addressed store, hash-verified

42class 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()

Callers 7

testConstModelMethod · 0.45
testVariableModelMethod · 0.45
testSignaturesMethod · 0.45
testSequentialModelMethod · 0.45
testConstantFoldingMethod · 0.45

Calls 8

allocate_tensorsMethod · 0.95
get_input_detailsMethod · 0.95
get_output_detailsMethod · 0.95
set_tensorMethod · 0.95
invokeMethod · 0.95
get_tensorMethod · 0.95
InterpreterClass · 0.90
numpyMethod · 0.45

Tested by

no test coverage detected