aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/weight_compressor.py
diff options
context:
space:
mode:
authorMauricio Briceno <mauricio.briceno@arm.com>2021-06-09 09:49:05 +0200
committerMauricio Briceno <mauricio.briceno@arm.com>2021-06-09 15:07:24 +0200
commit3e4168d741c167d2d52b1a3fc9a800c101bba09b (patch)
tree20a6f72b345d50e34b995effc72474d0df202f9c /ethosu/vela/weight_compressor.py
parentd784af7e8995a10fb403157af48371699c35bbfe (diff)
downloadethos-u-vela-3e4168d741c167d2d52b1a3fc9a800c101bba09b.tar.gz
mlw_codec: Fixed alignment warning
- Restructured pointer API to prevent alignment warnings - Changed weight tensor data type to np.int16 Change-Id: I310c1ca733bf98724c84e8b2194becb4be3e7eea
Diffstat (limited to 'ethosu/vela/weight_compressor.py')
-rw-r--r--ethosu/vela/weight_compressor.py4
1 files changed, 2 insertions, 2 deletions
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)