neural_compressor.utils.collect_layer_histogram
LayerHistogramCollector: save the histogram by layer.
Classes
The collector of the histogram by layer. |
Module Contents
- class neural_compressor.utils.collect_layer_histogram.LayerHistogramCollector(num_bins=8001, layer_tensor=None, include_layer=None, logger=None)[source]
The collector of the histogram by layer.
Saves layer histogram in a dict with layer names as keys and lists of NDArrays as values. The collected histogram will be used for calculating the optimal thresholds for quantization using KL divergence.