chromium/components/language_detection/core/quantization_utils.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

}  // namespace

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) {}

}  // namespace language_detection