From 316556666dd3f8518faa89598c7e3317a1fc41cf Mon Sep 17 00:00:00 2001 From: nishpoonia <94543206+nishpoonia@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:43:20 +0530 Subject: [PATCH] updating relu wrt new ref (#36) --- backends/cadence/hifi/operators/quantized_relu_out.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/cadence/hifi/operators/quantized_relu_out.cpp b/backends/cadence/hifi/operators/quantized_relu_out.cpp index 98f130df8c..6b7fae6e05 100644 --- a/backends/cadence/hifi/operators/quantized_relu_out.cpp +++ b/backends/cadence/hifi/operators/quantized_relu_out.cpp @@ -40,8 +40,8 @@ void quantized_relu_( -out_multiplier_data[0] * 1.0 / (1 << 31) * pow(2, out_shift_data[0]); for (size_t i = 0, e = input.numel(); i < e; ++i) { - const T temp = in[i] > q_zero_point ? (in[i] - q_zero_point) : 0; - out[i] = kernels::quantize(temp, out_scale, out_zero_point); + float temp = in[i] > q_zero_point ? (in[i] - q_zero_point) : 0; + out[i] = kernels::quantize(temp, out_scale, (int32_t)out_zero_point); } } @@ -65,7 +65,7 @@ void quantized_relu_out( out_multiplier.const_data_ptr()[0], out_shift.const_data_ptr()[0], (int)out_zero_point, - 0, + (int)out_zero_point, 255, input.numel()); @@ -83,7 +83,7 @@ void quantized_relu_out( out_multiplier.const_data_ptr()[0], out_shift.const_data_ptr()[0], (int)out_zero_point, - -128, + (int)out_zero_point, 127, input.numel());