From 7c50f1d6367186c03a282ac7ecb8fca0f905ba30 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Fri, 24 Nov 2023 18:25:55 +0000 Subject: 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 --- setup.cfg | 8 ++++---- src/mlia/nn/tensorflow/optimizations/quantization.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index a139bb4..4b6c931 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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) -- cgit v1.2.1