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)
19 lines
453 B
C++
19 lines
453 B
C++
#pragma once
|
|
|
|
#include "caffe2/quantization/server/quantization_error_minimization.h"
|
|
|
|
namespace dnnlowp {
|
|
|
|
/**
|
|
* A quantization scheme that minimizes Kullback-Leiber divergence.
|
|
*/
|
|
class KLDivergenceMinimization final : public QuantizationErrorMinimization {
|
|
public:
|
|
TensorQuantizationParams ChooseQuantizationParams(
|
|
const Histogram& hist,
|
|
bool preserve_sparsity = false,
|
|
int precision = 8) override;
|
|
};
|
|
|
|
} // namespace dnnlowp
|