diff options
author | Rickard Bolin <rickard.bolin@arm.com> | 2022-07-04 16:19:16 +0000 |
---|---|---|
committer | Rickard Bolin <rickard.bolin@arm.com> | 2022-09-23 09:13:20 +0000 |
commit | fea1516f94cfcbd801124e3fdc4b5f5c4526e15b (patch) | |
tree | 92b991244ef535d652d0bb6e875e9e3a289257f5 /ethosu/vela/weight_compressor.py | |
parent | cc219be4ec175645e8457da80d5effbf4324943b (diff) | |
download | ethos-u-vela-fea1516f94cfcbd801124e3fdc4b5f5c4526e15b.tar.gz |
MLBEDSW-6686: Resize bilinear HPC with tile padding
- Added support for Resize Bilinear with half pixel centers for int8 and
uint8.
- Utilizes the new "TILE" padding mode.
- Utilizes ofm stride multipliers and modified tile base offsets to
write OFMs interleaved.
Signed-off-by: Rickard Bolin <rickard.bolin@arm.com>
Change-Id: I37fa77c022a368f05fda0ead75d8696c9205f833
Diffstat (limited to 'ethosu/vela/weight_compressor.py')
-rw-r--r-- | ethosu/vela/weight_compressor.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py index db225fb6..6f9467ec 100644 --- a/ethosu/vela/weight_compressor.py +++ b/ethosu/vela/weight_compressor.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2021 Arm Limited or its affiliates. All rights reserved. +# Copyright (C) 2020-2022 Arm Limited or its affiliates. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # @@ -281,6 +281,12 @@ def _prepare_scale_and_bias(arch, tens, rescale_for_faf, explicit_scaling): else: quantised_scales = [quantise_scale(scale) for scale in scales] + # Check the output quantisation to see if the scale value needs increasing to the next one + if first_consumer_op.get_output_quantization().next_after: + for i, quant_scale in enumerate(quantised_scales): + q_scale, q_shift = quant_scale + quantised_scales[i] = (q_scale + 1, q_shift) + # If only 1 quantised scale is used, repeat that value for the length of the biases if len(quantised_scales) == 1: quantised_scales = [quantised_scales[0]] * len(biases) |