From eecc90165c5d37b75aca83f4d00cb4481872b238 Mon Sep 17 00:00:00 2001 From: Tai Ly Date: Thu, 29 Feb 2024 18:53:35 +0000 Subject: [tosa_mlir_translator] change rescale attrs to inputs This patch is for RescaleOp multiplier/shift changing from attributes to inputs Signed-off-by: Tai Ly Change-Id: I2fe3aa3cd37134f36873240c92b387b9610e3f9d --- src/TosaSerialize.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/TosaSerialize.cpp') diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index 0d5e044..74988c8 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -1356,10 +1356,6 @@ TosaSerializationOperatorBuilder::build( bool per_channel = op.getAttr("per_channel").dyn_cast().getValue(); - auto multiplier = - op.getAttr("multiplier").dyn_cast().asArrayRef(); - auto shift = getDenseI8ArrayAttr(op.getAttr("shift")); - bool input_unsigned = op.getAttr("input_unsigned").dyn_cast().getValue(); bool output_unsigned = @@ -1371,15 +1367,18 @@ TosaSerializationOperatorBuilder::build( auto output_ty = output.getType().cast(); std::string input_name = GetTensorName(input); + std::string multiplier_name = GetTensorName(op.getOperand(1)); + std::string shift_name = GetTensorName(op.getOperand(2)); std::string output_name = GetTensorName(output); - TosaRescaleAttribute attribute(input_zp, output_zp, multiplier, shift, + TosaRescaleAttribute attribute(input_zp, output_zp, + /* multiplier = */ {}, /* shift = */ {}, scale32, double_round, per_channel, input_unsigned, output_unsigned); TosaSerializationOperator *tyop = new TosaSerializationOperator( Op_RESCALE, Attribute_RescaleAttribute, &attribute, - std::vector{input_name}, + std::vector{input_name, multiplier_name, shift_name}, std::vector{output_name}); return tyop; -- cgit v1.2.1