From 58520b981013214e458b5a7ff1983d919d6d2363 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Mon, 24 Aug 2020 16:45:38 +0200 Subject: 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 Change-Id: I4f4db464d77b0aaf0d25ddfca534f91d08db548d --- ethosu/vela/register_command_stream_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethosu/vela/register_command_stream_generator.py') 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) -- cgit v1.2.1