mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/73227 Reviewed By: christycylee Differential Revision: D34016914 fbshipit-source-id: 277937f3c13a54ea1180afac253ee9927e56e99e (cherry picked from commit d97777318170a406d89755e577386cde857dd59b)
34 lines
620 B
C++
34 lines
620 B
C++
#pragma once
|
|
|
|
#include "caffe2/quantization/server/quantization_error_minimization.h"
|
|
|
|
#include <algorithm>
|
|
#include <cassert>
|
|
#include <cmath>
|
|
#include <iostream>
|
|
#include <limits>
|
|
|
|
namespace dnnlowp {
|
|
|
|
/**
|
|
* A quantization scheme that minimizes L2 norm of quantization error.
|
|
*/
|
|
class L2ErrorMinimization : public NormMinimization {
|
|
public:
|
|
L2ErrorMinimization() : NormMinimization(L2){};
|
|
};
|
|
|
|
namespace internal {
|
|
|
|
float L2MinimizationKernelAVX2(
|
|
int precision,
|
|
float* bins,
|
|
int nbins,
|
|
float bin_width,
|
|
float dst_bin_width,
|
|
int start_bin);
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace dnnlowp
|