mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix Bug where zero point isn't correct under entropy calibration (#13346)
### Description Fix Bug where zero point isn't correct under entropy calibration ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
parent
61ee5585b2
commit
e3982416d3
1 changed files with 6 additions and 1 deletions
|
|
@ -817,7 +817,12 @@ class HistogramCollector(CalibrationDataCollector):
|
|||
|
||||
min_kl_divergence_idx = np.argmin(kl_divergence)
|
||||
optimal_threshold = thresholds[min_kl_divergence_idx]
|
||||
|
||||
min_value = histogram[2]
|
||||
max_value = histogram[3]
|
||||
if optimal_threshold[0] < min_value:
|
||||
optimal_threshold = (min_value, optimal_threshold[1])
|
||||
if optimal_threshold[1] > max_value:
|
||||
optimal_threshold = (optimal_threshold[0], max_value)
|
||||
return optimal_threshold
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue