From 3e4168d741c167d2d52b1a3fc9a800c101bba09b Mon Sep 17 00:00:00 2001 From: Mauricio Briceno Date: Wed, 9 Jun 2021 09:49:05 +0200 Subject: mlw_codec: Fixed alignment warning - Restructured pointer API to prevent alignment warnings - Changed weight tensor data type to np.int16 Change-Id: I310c1ca733bf98724c84e8b2194becb4be3e7eea --- ethosu/vela/weight_compressor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu/vela') diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py index 4ce03d55..5f211393 100644 --- a/ethosu/vela/weight_compressor.py +++ b/ethosu/vela/weight_compressor.py @@ -314,8 +314,8 @@ def encode_weight_and_scale_tensor( assert weight_tens.quantization.zero_point is not None # Early zero-point correction - quant_buf = weight_tens.quant_values.astype(np.int64) - weights = quant_buf - weight_tens.quantization.zero_point + quant_buf = weight_tens.quant_values.astype(np.int16) + weights = quant_buf - weight_tens.quantization.zero_point.astype(np.int16) if len(weights.shape) == 2: weights = np.expand_dims(np.expand_dims(weights, axis=0), axis=0) -- cgit v1.2.1