diff options
author | Charles Xu <charles.xu@arm.com> | 2020-06-11 12:39:19 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | 749d92115e8ac7d0cc755ce93ea8a8c53fd6e474 (patch) | |
tree | a71e8c5b5d87ee4123d01ad744b7b5041356bcc7 /ethosu/vela | |
parent | 7b8823f0e27ec115a2e151ebc0382a49fce36894 (diff) | |
download | ethos-u-vela-749d92115e8ac7d0cc755ce93ea8a8c53fd6e474.tar.gz |
MLBEDSW-2468: Rounding 16bit scale multiplier by 0.5
Signed-off-by: Charles Xu <charles.xu@arm.com>
Change-Id: I78f475f9837a7c11f01b2693b17efe1a7c6481cc
Diffstat (limited to 'ethosu/vela')
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index 38ab6c15..c46016d7 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -607,7 +607,7 @@ def generate_register_command_stream(nng, sg, arch, verbose=False): rescale = 0x3000 * cmd.ifm_tensor.quantization.scale_f32 if cmd.ifm_tensor.dtype == DataType.int16: - multiplier = max(1, int(4096 * cmd.ifm_tensor.quantization.scale_f32)) + multiplier = max(1, int(4096 * cmd.ifm_tensor.quantization.scale_f32 + 0.5)) rescale *= 3 * multiplier rescale_bits = len(bin(round_up_to_int(rescale))) - 2 + 1 |