MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RequantizeManyInNewRange

Function RequantizeManyInNewRange

tensorflow/core/kernels/quantization_utils.h:227–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225
226template <class T1, class T2>
227inline 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

Calls

no outgoing calls

Tested by 3

TestRequantizeManyFunction · 0.68