未验证 提交 4d891c00 编写于 作者: J joanna.wozna.intel 提交者: GitHub

Add corner case in scale calculation (#37352)

上级 bb2733fa
......@@ -306,7 +306,7 @@ AnalysisPredictor::MkldnnQuantizer::GetKLScalingFactor(
std::vector<int> reference_distr_P(&hist[0], &hist[i]);
auto outliers_count =
std::accumulate(&hist[i], &hist[precision_hist_num_bins], 0);
if (reference_distr_P[i - 1] == 0) {
if (i <= 0 || reference_distr_P[i - 1] == 0) {
continue;
}
reference_distr_P[i - 1] += outliers_count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册