aboutsummaryrefslogtreecommitdiff
path: root/src/TosaSerialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/TosaSerialize.cpp')
-rw-r--r--src/TosaSerialize.cpp14
1 files changed, 10 insertions, 4 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<mlir::tosa::RescaleOp>(
op.getAttr("multiplier").dyn_cast<mlir::DenseI32ArrayAttr>().asArrayRef();
auto shift = getDenseI8ArrayAttr<int32_t>(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<mlir::RankedTensorType>();
+ auto output = op.getResult(0);
+ auto output_ty = output.getType().cast<mlir::RankedTensorType>();
+
+ 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,