mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 00:19:58 +01:00
Warn if tf.lite.interpreter is used instead of ai-edge-litert.interpreter
PiperOrigin-RevId: 696217271
This commit is contained in:
parent
0ad73f5790
commit
21dce87276
|
|
@ -74,6 +74,8 @@ This release contains contributions from many people at Google, as well as:
|
|||
### Breaking Changes
|
||||
|
||||
* `tf.lite`
|
||||
* Interpreter:
|
||||
* `tf.lite.Interpreter` gives a deprecation warning and a redirection notice to its new location at `ai_edge_litert.interpreter`. See the [migration guide](https://ai.google.dev/edge/litert/migration) for details.
|
||||
* C API:
|
||||
* An optional, fourth parameter was added `TfLiteOperatorCreate` as a step forward towards a cleaner API for `TfLiteOperator`. Function `TfLiteOperatorCreate` was added recently, in TensorFlow Lite version 2.17.0, released on 7/11/2024, and we do not expect there will be much code using this function yet. Any code breakages can be easily resolved by passing nullptr as the new, 4th parameter.
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import enum
|
|||
import os
|
||||
import platform
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
@ -40,6 +41,12 @@ else:
|
|||
|
||||
# pylint: enable=g-import-not-at-top
|
||||
|
||||
_INTERPRETER_DEPRECATION_WARNING = """\
|
||||
Warning: Please use the LiteRT interpreter from the ai_edge_litert package.
|
||||
See the [migration guide](https://ai.google.dev/edge/litert/migration)
|
||||
for details.
|
||||
"""
|
||||
|
||||
|
||||
class Delegate:
|
||||
"""Python wrapper class to manage TfLiteDelegate objects.
|
||||
|
|
@ -441,6 +448,7 @@ class Interpreter:
|
|||
Raises:
|
||||
ValueError: If the interpreter was unable to create.
|
||||
"""
|
||||
warnings.warn(_INTERPRETER_DEPRECATION_WARNING)
|
||||
if not hasattr(self, '_custom_op_registerers'):
|
||||
self._custom_op_registerers = []
|
||||
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ tf_staging/tensorflow/lite/lib_package/BUILD:
|
|||
tf_staging/tensorflow/lite/model.h:
|
||||
tf_staging/tensorflow/lite/model_builder.h:
|
||||
tf_staging/tensorflow/lite/namespace.h:
|
||||
tf_staging/tensorflow/lite/python/interpreter.py:
|
||||
tf_staging/tensorflow/lite/schema/conversion_metadata_generated.h:
|
||||
tf_staging/tensorflow/lite/schema/schema_generated.h:
|
||||
tf_staging/tensorflow/lite/signature_runner.h:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user