File tree Expand file tree Collapse file tree
backends/cadence/hifi/operators Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments