From 8833846f0ad7852bb0c57cc4938e086c8d7b8737 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Fri, 8 Sep 2023 17:50:11 +0000 Subject: Update to handle unsigned attributes for RESCALE Check the operand data types to determine whether the RESCALE is operating on signed or unsigned values for the signless type. Signed-off-by: Eric Kunze Change-Id: Ie6fb4f4c128598dccefdded10774a0af0238eede --- src/TosaSerialize.cpp | 14 ++++++++++---- third_party/serialization_lib | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index 941a75e..b894383 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -1392,11 +1392,17 @@ TosaSerializationOperatorBuilder::build( op.getAttr("multiplier").dyn_cast().asArrayRef(); auto shift = getDenseI8ArrayAttr(op.getAttr("shift")); - std::string input_name = GetTensorName(op.getOperand(0)); - std::string output_name = GetTensorName(op.getResult(0)); + auto input = op.getOperand(0); + auto input_ty = input.getType().cast(); + auto output = op.getResult(0); + auto output_ty = output.getType().cast(); + + std::string input_name = GetTensorName(input); + std::string output_name = GetTensorName(output); - TosaRescaleAttribute attribute(input_zp, output_zp, multiplier, shift, - scale32, double_round, per_channel); + TosaRescaleAttribute attribute( + input_zp, output_zp, multiplier, shift, scale32, double_round, + per_channel, input_ty.isUnsignedInteger(), output_ty.isUnsignedInteger()); TosaSerializationOperator *tyop = new TosaSerializationOperator( Op_RESCALE, Attribute_RescaleAttribute, &attribute, diff --git a/third_party/serialization_lib b/third_party/serialization_lib index c6939a4..9601cbd 160000 --- a/third_party/serialization_lib +++ b/third_party/serialization_lib @@ -1 +1 @@ -Subproject commit c6939a4d269968a34b0ae0aa579f0f0736aaeccc +Subproject commit 9601cbda5ff42dc4762e364d90093670931e1261 -- cgit v1.2.1