| 225 | |
| 226 | template <class T1, class T2> |
| 227 | inline void RequantizeManyInNewRange(const T1* input, int64 count, |
| 228 | float min_input, float max_input, |
| 229 | float min_output, float max_output, |
| 230 | T2* output) { |
| 231 | for (size_t index = 0; index < count; ++index) { |
| 232 | const float input_float = |
| 233 | QuantizedToFloat<T1>(input[index], min_input, max_input); |
| 234 | output[index] = FloatToQuantized<T2>(input_float, min_output, max_output); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | // Because converting 32-bit accumulated results down to eight bit is a common |
| 239 | // case, we have a specialized code path to handle it as efficiently as |
no outgoing calls