summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
diff options
context:
space:
mode:
authorFeng Liu <fengliuai@google.com>2019-07-18 11:25:53 -0700
committerMehdi Amini <joker.eph@gmail.com>2019-07-19 11:39:54 -0700
commit701266c47abab7180d36ae174f19d76a113a77a4 (patch)
tree697c3673664e24484f80ba7a58fdc74c68c1531a /mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
parent90b5a381ce1ae04c4d67071c1098c946848cb342 (diff)
downloadbcm5719-llvm-701266c47abab7180d36ae174f19d76a113a77a4.tar.gz
bcm5719-llvm-701266c47abab7180d36ae174f19d76a113a77a4.zip
Add an "is_signed" attribute to the quant_ConstFakeQuant op
Some TensorFlow simulated quantize ops such as QuantizeAndDequantizeV2Op have attribute for the sign of the quantization, so quant_ConstFakeQuant should be able to represent it with the new attribute is added. The method for converting these attributes to an QuantizedType is updated to handle this new argument. PiperOrigin-RevId: 258810290
Diffstat (limited to 'mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp')
-rw-r--r--mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp b/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
index 0c93146a232..32d8c8a81c1 100644
--- a/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
+++ b/mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
@@ -70,7 +70,7 @@ public:
UniformQuantizedType uniformElementType = fakeQuantAttrsToType(
fqOp.getLoc(), fqOp.num_bits().getSExtValue(),
fqOp.min().convertToFloat(), fqOp.max().convertToFloat(),
- fqOp.narrow_range(), converter.expressedType);
+ fqOp.narrow_range(), converter.expressedType, fqOp.is_signed());
if (!uniformElementType) {
// Note that the fakeQuantAttrsToType will have emitted the error.
OpenPOWER on IntegriCloud