diff --git a/caffe2/quantization/server/conv_dnnlowp_op.cc b/caffe2/quantization/server/conv_dnnlowp_op.cc index aa5a39ccdac312..f5395617d51b68 100644 --- a/caffe2/quantization/server/conv_dnnlowp_op.cc +++ b/caffe2/quantization/server/conv_dnnlowp_op.cc @@ -905,6 +905,10 @@ void ConvDNNLowPOp::RunOnDeviceEpilogueNHWC_( Y_min = std::max(0, Y_min); Y_max = std::max(0, Y_max); } + if (Y_min == numeric_limits::max() && Y_max == numeric_limits::min()) { + Y_min = 0; + Y_max = 0; + } float Y_scale = in_qparams_[INPUT].scale * FilterQuantizationParams(0).scale;