diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-11-24 18:25:55 +0000 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-12-04 15:37:15 +0000 |
commit | 7c50f1d6367186c03a282ac7ecb8fca0f905ba30 (patch) | |
tree | 00d78c2e5236ae11dd66643489b9648be643592b | |
parent | 60e97eb8711eee9a682bc58820ca3e218d0baa56 (diff) | |
download | mlia-7c50f1d6367186c03a282ac7ecb8fca0f905ba30.tar.gz |
Update to Vela 3.10, TensorFlow 2.14, Python 3.9
Updating to Vela 3.10 which requires TensorFlow 2.14 which requires
Python 3.9 (dropping support for Python 3.8).
Resolves: MLIA-997
Change-Id: Id60bd08f7156a8efa204ef71ba81590edf0e3b28
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
-rw-r--r-- | setup.cfg | 8 | ||||
-rw-r--r-- | src/mlia/nn/tensorflow/optimizations/quantization.py | 2 |
2 files changed, 5 insertions, 5 deletions
@@ -24,17 +24,17 @@ keywords = ml, arm, ethos-u, tflite [options] include_package_data = True -python_requires = >=3.8.1 +python_requires = >=3.9.0 package_dir = = src packages = find_namespace: install_requires = - tensorflow~=2.12.1 + tensorflow~=2.14.1 tensorflow-model-optimization~=0.7.5 - ethos-u-vela~=3.9.0 + ethos-u-vela~=3.10.0 flaky~=3.7.0 requests~=2.31.0 - rich~=13.5.2 + rich~=13.7.0 tomli~=2.0.1 ; python_version<"3.11" [options.packages.find] diff --git a/src/mlia/nn/tensorflow/optimizations/quantization.py b/src/mlia/nn/tensorflow/optimizations/quantization.py index 4e3c2c2..02c1d08 100644 --- a/src/mlia/nn/tensorflow/optimizations/quantization.py +++ b/src/mlia/nn/tensorflow/optimizations/quantization.py @@ -68,7 +68,7 @@ def quantize( ), f"Input tensor for quantization is of type {tensor.dtype}, but it must be float." quantized_tensor = (tensor / quant_params.scales) + quant_params.zero_points - quantized_tensor = np.clip( # type: ignore + quantized_tensor = np.clip( quantized_tensor, -128, 127, dtype=np.int8, casting="unsafe" ) return cast(np.ndarray, quantized_tensor) |