Skip to content

Commit 3165566

Browse files
authored
updating relu wrt new ref (#36)
1 parent d730ed8 commit 3165566

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

backends/cadence/hifi/operators/quantized_relu_out.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void quantized_relu_(
4040
-out_multiplier_data[0] * 1.0 / (1 << 31) * pow(2, out_shift_data[0]);
4141

4242
for (size_t i = 0, e = input.numel(); i < e; ++i) {
43-
const T temp = in[i] > q_zero_point ? (in[i] - q_zero_point) : 0;
44-
out[i] = kernels::quantize<T>(temp, out_scale, out_zero_point);
43+
float temp = in[i] > q_zero_point ? (in[i] - q_zero_point) : 0;
44+
out[i] = kernels::quantize<T>(temp, out_scale, (int32_t)out_zero_point);
4545
}
4646
}
4747

@@ -65,7 +65,7 @@ void quantized_relu_out(
6565
out_multiplier.const_data_ptr<int32_t>()[0],
6666
out_shift.const_data_ptr<int32_t>()[0],
6767
(int)out_zero_point,
68-
0,
68+
(int)out_zero_point,
6969
255,
7070
input.numel());
7171

@@ -83,7 +83,7 @@ void quantized_relu_out(
8383
out_multiplier.const_data_ptr<int32_t>()[0],
8484
out_shift.const_data_ptr<int32_t>()[0],
8585
(int)out_zero_point,
86-
-128,
86+
(int)out_zero_point,
8787
127,
8888
input.numel());
8989

0 commit comments

Comments
 (0)