Add an "is_signed" attribute to the quant_ConstFakeQuant op
authorFeng Liu <fengliuai@google.com>
Thu, 18 Jul 2019 18:25:53 +0000 (11:25 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 19 Jul 2019 18:39:54 +0000 (11:39 -0700)
commit701266c47abab7180d36ae174f19d76a113a77a4
tree697c3673664e24484f80ba7a58fdc74c68c1531a
parent90b5a381ce1ae04c4d67071c1098c946848cb342
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
mlir/include/mlir/Dialect/QuantOps/QuantOps.td
mlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
mlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
mlir/test/Dialect/QuantOps/convert-fakequant.mlir