diff options
author | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2021-02-01 21:42:12 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2021-02-02 12:47:40 +0000 |
commit | f2afd7f8a893487f5e1ecb96e3406a5b04f258d2 (patch) | |
tree | 9b9743d53a41de1e49cf02dd8c651d51a6f55f60 /ethosu/vela | |
parent | ebf4af6a45c60d3f75ccd6019612a7f8b6552d72 (diff) | |
download | ethos-u-vela-f2afd7f8a893487f5e1ecb96e3406a5b04f258d2.tar.gz |
[MLBEDSW-1743] Fix scaling for Abs operator
Fixed the scaling for the Abs operator.
Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com>
Change-Id: I9c198547de18f1268bfc2cb2f3d79cb30de4f43e
Diffstat (limited to 'ethosu/vela')
-rw-r--r-- | ethosu/vela/high_level_command_to_npu_op.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py index 31434835..8d6fc871 100644 --- a/ethosu/vela/high_level_command_to_npu_op.py +++ b/ethosu/vela/high_level_command_to_npu_op.py @@ -428,6 +428,8 @@ def create_npu_elementwise_op(cmd: NpuStripe, arch: ArchitectureFeatures) -> Npu # Force output scale same as the input scale for # resizebilinear 1x1 that is converted to add output_scale = npu_op.ifm2.quantization.scale_f32 + if op.type == Op.Abs: + output_scale = npu_op.ifm.quantization.scale_f32 / npu_op.ofm.quantization.scale_f32 if op.type == Op.LeakyRelu: output_scale = op.attrs["alpha"] if op.type == Op.RescaleAdd: |