From 99e2e1c999ab635433eeaeb72fc9468f89a39dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henri=20Gr=C3=BCnder?= Date: Thu, 4 Apr 2024 09:55:29 +0200 Subject: [PATCH] Refactor type of shift argument passed to tosa.rescale Closes #406 --- reference-implementation/include/emitc/tosa.h | 2 +- reference-implementation/unittests/tosa.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference-implementation/include/emitc/tosa.h b/reference-implementation/include/emitc/tosa.h index 6e3061e5..12d5e955 100644 --- a/reference-implementation/include/emitc/tosa.h +++ b/reference-implementation/include/emitc/tosa.h @@ -105,7 +105,7 @@ inline Src reciprocal(Src x) { template inline Dest rescale(Src x, typename get_element_type::type in_zp, typename get_element_type::type out_zp, - Tensor1D mult, Tensor1D shift, + Tensor1D mult, Tensor1D shift, bool scale32, bool double_round, bool per_channel) { using ET_Dest = typename get_element_type::type; using Dest_I32 = typename replace_element_type::type; diff --git a/reference-implementation/unittests/tosa.cpp b/reference-implementation/unittests/tosa.cpp index 99130f72..4724e48e 100644 --- a/reference-implementation/unittests/tosa.cpp +++ b/reference-implementation/unittests/tosa.cpp @@ -225,7 +225,7 @@ TEST(tosa, rescale) { int8_t in_zp = 10; int16_t out_zp = 0; Tensor1D mult{10000}; - Tensor1D shift{5}; + Tensor1D shift{5}; bool scale32 = false; bool double_round = false; bool per_channel = false; @@ -241,7 +241,7 @@ TEST(tosa, rescale) { int32_t in_zp = 0; int8_t out_zp = 0; Tensor1D mult{150, 100, 50}; - Tensor1D shift{13, 14, 15}; + Tensor1D shift{13, 14, 15}; bool scale32 = false; bool double_round = false; bool per_channel = true; @@ -258,7 +258,7 @@ TEST(tosa, rescale) { int64_t in_zp = 0; uint8_t out_zp = 100; Tensor1D mult{100}; - Tensor1D shift{14}; + Tensor1D shift{14}; bool scale32 = false; bool double_round = false; bool per_channel = false; @@ -278,7 +278,7 @@ TEST(tosa, rescale) { int64_t in_zp = 0; int32_t out_zp = 0; Tensor1D mult{2147483647}; - Tensor1D shift{32}; + Tensor1D shift{32}; bool scale32 = true; bool double_round = true; bool per_channel = false;