Skip to content

Commit

Permalink
[fbgemm] check min<=max in ChooseQuantizationParams (pytorch#95529)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#95529

X-link: pytorch/FBGEMM#1612

pytorch/FBGEMM#1590

Test Plan: CI

Reviewed By: summerdengfb

Differential Revision: D43383474

fbshipit-source-id: 337c82fa89b14b3633a2d61f233c98c1994bc71e
  • Loading branch information
jspark1105 authored and facebook-github-bot committed Feb 26, 2023
1 parent 6c30dc6 commit e088411
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caffe2/quantization/server/conv_dnnlowp_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,10 @@ void ConvDNNLowPOp<T, ReluFused>::RunOnDeviceEpilogueNHWC_(
Y_min = std::max(0, Y_min);
Y_max = std::max(0, Y_max);
}
if (Y_min == numeric_limits<int32_t>::max() && Y_max == numeric_limits<int32_t>::min()) {
Y_min = 0;
Y_max = 0;
}

float Y_scale =
in_qparams_[INPUT].scale * FilterQuantizationParams(0).scale;
Expand Down

0 comments on commit e088411

Please sign in to comment.