summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/QuantOps
diff options
context:
space:
mode:
authorFeng Liu <fengliuai@google.com>2019-08-29 10:08:46 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-08-29 10:09:22 -0700
commit6de6c2c13828742249377585fd1ef19d9cfd1773 (patch)
treedd0ef16c044bd319e82aa80edad5d9c4f62667fa /mlir/lib/Dialect/QuantOps
parent4bb6f8ecdb54f4ee096d8f92603d628d0cac4ed6 (diff)
downloadbcm5719-llvm-6de6c2c13828742249377585fd1ef19d9cfd1773.tar.gz
bcm5719-llvm-6de6c2c13828742249377585fd1ef19d9cfd1773.zip
Add tests to verify 0.0 is quantized correctly
We should consider both signed and narrow_range cases. PiperOrigin-RevId: 266167366
Diffstat (limited to 'mlir/lib/Dialect/QuantOps')
-rw-r--r--mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp b/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
index eeb69b77102..637f6a04988 100644
--- a/mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
+++ b/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<double>::epsilon()) {
return UniformQuantizedType::getChecked(flags, storageType, expressedType,
- 1.0, 0, qmin, qmax, loc);
+ 1.0, qmin, qmin, qmax, loc);
}
// Determine the scale.
OpenPOWER on IntegriCloud