aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tensor.py
diff options
context:
space:
mode:
authorJohan Alfven <johan.alfven@arm.com>2023-04-03 15:29:13 +0200
committerJohan Alfven <johan.alfven@arm.com>2023-04-04 15:44:15 +0200
commit347c57bb88c1286bcd1c2775e7c67296410e2e6d (patch)
tree98c209e597be597b67853bfc0ee50c255dac1370 /ethosu/vela/tensor.py
parent56811e6d3c62ae017f6eb298fb553f7d1e77cc96 (diff)
downloadethos-u-vela-347c57bb88c1286bcd1c2775e7c67296410e2e6d.tar.gz
MLBEDSW-7442: Removed ofm quantization for ArgMax
- Quantization for the OFM was added for the ArgMax operator as a workaround in order to avoid a crash in the weight compressor. This quantization is now removed. - The weight compressor expects that all tensors have a quantization. Updated code to use scale = 1.0 and zero point = 0 for tensor without quantization. Change-Id: I6816dce2db55f7d795d19f88d7fbe7ee419347fc Signed-off-by: Johan Alfven <johan.alfven@arm.com>
Diffstat (limited to 'ethosu/vela/tensor.py')
-rw-r--r--ethosu/vela/tensor.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py
index 51c7592e..9ba6ab77 100644
--- a/ethosu/vela/tensor.py
+++ b/ethosu/vela/tensor.py
@@ -229,6 +229,8 @@ class QuantizationParameters:
max: Union[float, np.ndarray, None] = None,
num_bits=None,
narrow_range=None,
+ scale_f32: Union[float, np.ndarray, None] = None,
+ zero_point: Union[int, np.ndarray, None] = None,
):
self.min = min
self.max = max
@@ -240,8 +242,8 @@ class QuantizationParameters:
# natural rounding to perform rounding away from zero. This only affects the ofm scale and bias tensor, it has
# no affect on global scaling i.e. the ofm_scale register
self.next_after = False
- self.scale_f32: Union[float, np.ndarray, None] = None
- self.zero_point: Union[int, np.ndarray, None] = None
+ self.scale_f32: Union[float, np.ndarray, None] = scale_f32
+ self.zero_point: Union[int, np.ndarray, None] = zero_point
self.quant_min: Optional[float] = None
self.quant_max: Optional[float] = None
self.quant_dim: Optional[int] = None