#include "components/language_detection/core/quantization_utils.h"
#include <algorithm>
#include <cmath>
#include "base/check_op.h"
namespace language_detection {
namespace {
void Nudge(const float min,
const float max,
const unsigned int quant_min,
const unsigned int quant_max,
float* nudged_min,
float* nudged_max,
float* scale) { … }
}
QuantizationParams GetQuantizationParams(float min_val,
float max_val,
int num_bits) { … }
uint32_t FloatToQuantized(float x, float min_val, float max_val, int num_bits) { … }
float QuantizedToFloat(uint32_t x, float min_val, float max_val, int num_bits) { … }
}