提交 14a32bf0 编写于 作者: Y Yihua Xu 提交者: Tao Luo

Fix the accuracy issue while using float precision to get the scale. (#17884)

test=develop
上级 fba10b6b
......@@ -429,7 +429,9 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
// scale couldn't be calculated
else
output_shift_scale[i] =
scale_out_data / (scale_in_data * scale_weights_data[i]);
static_cast<float>(static_cast<double>(scale_out_data) /
(static_cast<double>(scale_in_data) *
static_cast<double>(scale_weights_data[i])));
}
auto user_src_md =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册