diff options
author | Tai Ly <tai.ly@arm.com> | 2023-07-14 17:02:12 +0000 |
---|---|---|
committer | Tai Ly <tai.ly@arm.com> | 2023-07-14 20:47:41 +0000 |
commit | 1acb3672107eeb94c7c23d13c24df3d7671dbcc6 (patch) | |
tree | ab6b1aea60caf171c6eb226eec12deed28aa360d /src | |
parent | 787606544db8664ff42a31958f554fe7088427b5 (diff) | |
download | tosa_mlir_translator-1acb3672107eeb94c7c23d13c24df3d7671dbcc6.tar.gz |
Fix PadOp serialization for input_zp
This fixes previously introduced bug where the input_zp was
dropped from the PadOp serialization.
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I42fec4a2cdad0ab1ea3cc2f188c4f4c4467583b0
Diffstat (limited to 'src')
-rw-r--r-- | src/TosaSerialize.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index fec9f17..66d0a31 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -931,7 +931,9 @@ TosaSerializationOperatorBuilder::build<mlir::tosa::PadOp>( paddings.push_back(val); } - int32_t pad_const_int = 0; + auto quant_info = pad_op.getQuantizationInfoAttr(); + // pad_const includes the zero point if the tensor uses a zero point. + int32_t pad_const_int = quant_info ? quant_info.getInputZp() : 0; float pad_const_fp = 0.f; if (auto tensor = pad_op.getPadConst()) { |