update the tensorflow.lite to use ai-edge-litert for all python based… (#2702)

This commit is contained in:
RJ Ascani 2024-09-26 09:11:38 -07:00 committed by GitHub
parent 68d83a684d
commit bf2ba11d93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 26 additions and 11 deletions

View file

@ -94,6 +94,7 @@ py_test(
],
deps = [
":runtime",
requirement("ai-edge-litert"),
requirement("numpy"),
requirement("tensorflow"),
"//tensorflow/lite/micro/examples/recipes:add_four_numbers",

View file

@ -25,6 +25,7 @@ import weakref
import numpy as np
import tensorflow as tf
from ai_edge_litert import interpreter as litert_interpreter
from tensorflow.python.framework import test_util
from tensorflow.python.platform import test
from tflite_micro.python.tflite_micro import runtime
@ -199,10 +200,10 @@ class ConvModelTests(test_util.TensorFlowTestCase):
tflm_interpreter = runtime.Interpreter.from_bytes(model_data)
# TFLite interpreter
tflite_interpreter = tf.lite.Interpreter(
tflite_interpreter = litert_interpreter.Interpreter(
model_content=model_data,
experimental_op_resolver_type=\
tf.lite.experimental.OpResolverType.BUILTIN_REF)
litert_interpreter.OpResolverType.BUILTIN_REF)
tflite_interpreter.allocate_tensors()
tflite_output_details = tflite_interpreter.get_output_details()[0]
tflite_input_details = tflite_interpreter.get_input_details()[0]