From cc8569fcd243d7c96a20e0f531f6f97a90df83f7 Mon Sep 17 00:00:00 2001 From: Fredrik Svedberg Date: Mon, 1 Nov 2021 14:25:29 +0100 Subject: MLBEDSW-5209 Vela: output diff depthwise with non-zero zero points Fixed by adjusting zero points for ops with int8 IFM and asymmetric weights since the reference does not support asymmetric weights for int8 IFM and ignores the zero points. Signed-off-by: Fredrik Svedberg Change-Id: I2a206a01a471a53aa864a6a3616aa23d2a5a23c8 --- ethosu/vela/tensor.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/tensor.py') diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py index d62ebc8e..8c5e277a 100644 --- a/ethosu/vela/tensor.py +++ b/ethosu/vela/tensor.py @@ -209,7 +209,17 @@ def create_equivalence_id(key) -> UUID: class QuantizationParameters: - __slots__ = "min", "max", "num_bits", "narrow_range", "scale_f32", "zero_point", "quant_min", "quant_max" + __slots__ = ( + "min", + "max", + "num_bits", + "narrow_range", + "scale_f32", + "zero_point", + "quant_min", + "quant_max", + "quant_dim", + ) def __init__( self, @@ -228,6 +238,7 @@ class QuantizationParameters: self.zero_point: Union[int, np.ndarray, None] = None self.quant_min: Optional[float] = None self.quant_max: Optional[float] = None + self.quant_dim: Optional[int] = None def __str__(self): return "" % ( @@ -252,6 +263,7 @@ class QuantizationParameters: res.zero_point = self.zero_point res.quant_min = self.quant_min res.quant_max = self.quant_max + res.quant_dim = self.quant_dim return res def dequantize(self, values) -> np.ndarray: -- cgit v1.2.1