-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Module:QuantizationIssues related to QuantizationIssues related to QuantizationduplicateThis issue or pull request already existsThis issue or pull request already existstriagedIssue has been triaged by maintainersIssue has been triaged by maintainers
Description
Description
In pytorch-quantization package, the _normalize_distr(distr) function in entropy calibrator is not right.
def _normalize_distr(distr):
summ = np.sum(distr)
if summ != 0:
distr = distr / summ
This won't actually normalize the input distr as expected. The distr =
is a new array. To achieve in-place, it should be distr /= summ
.
The reason this calibrator still works is that in scipy's entropy function, scipy also performs normalization. But we better fix it here in case scipy changes its implementation.
Metadata
Metadata
Assignees
Labels
Module:QuantizationIssues related to QuantizationIssues related to QuantizationduplicateThis issue or pull request already existsThis issue or pull request already existstriagedIssue has been triaged by maintainersIssue has been triaged by maintainers