aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/register_command_stream_generator.py
diff options
context:
space:
mode:
authorLouis Verhaard <louis.verhaard@arm.com>2020-08-24 16:45:38 +0200
committerLouis Verhaard <louis.verhaard@arm.com>2020-08-26 16:52:37 +0200
commit58520b981013214e458b5a7ff1983d919d6d2363 (patch)
treea7be754975e158ba1f3dd6fc3658e4daa300a025 /ethosu/vela/register_command_stream_generator.py
parent90831bc18d45008b703e59aad0594026beb7da82 (diff)
downloadethos-u-vela-58520b981013214e458b5a7ff1983d919d6d2363.tar.gz
MLBEDSW-2688: use LeakyRelu for int16
For int16, using LeakyRelu (with bug fix) gives exactly the same results as Mul+Max if input/output scales are the same. Signed-off-by: Louis Verhaard <louis.verhaard@arm.com> Change-Id: I4f4db464d77b0aaf0d25ddfca534f91d08db548d
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r--ethosu/vela/register_command_stream_generator.py2
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 5a14cb4f..8d9f9185 100644
--- a/ethosu/vela/register_command_stream_generator.py
+++ b/ethosu/vela/register_command_stream_generator.py
@@ -533,7 +533,7 @@ def generate_register_command_stream(nng, sg, arch, verbose=False):
use_global_scale = True
if primary_op.type == "LeakyRelu":
- output_scale *= primary_op.attrs["alpha"]
+ output_scale = primary_op.attrs["alpha"]
ofm_scale, shift = scaling.quantise_scale(output_scale)
emit.cmd1_with_offset(cmd1.NPU_SET_OFM_SCALE, ofm_scale, shift)