From 8a94f84e7e713550e20b6c292cc0506feb38aa27 Mon Sep 17 00:00:00 2001 From: Feng Liu Date: Thu, 29 Aug 2019 10:08:46 -0700 Subject: [PATCH] Add tests to verify 0.0 is quantized correctly We should consider both signed and narrow_range cases. PiperOrigin-RevId: 266167366 --- .../mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp b/third_party/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp index eeb69b77102..637f6a04988 100644 --- a/third_party/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp +++ b/third_party/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp @@ -76,7 +76,7 @@ mlir::quant::fakeQuantAttrsToType(Location loc, unsigned numBits, double rmin, // points and dequantized to 0.0. if (std::fabs(rmax - rmin) < std::numeric_limits::epsilon()) { return UniformQuantizedType::getChecked(flags, storageType, expressedType, - 1.0, 0, qmin, qmax, loc); + 1.0, qmin, qmin, qmax, loc); } // Determine the scale.