From 150bc9bcdea84f8c24a17d5f2fcb38128afe50ab Mon Sep 17 00:00:00 2001 From: Tai Ly Date: Thu, 22 Feb 2024 22:22:24 +0000 Subject: [tosa_mlir_translator] Change resize attrs to inputs This patch changes tosa resize op's scale/offset/border from attributes to inputs of tosa.shape type Signed-off-by: Tai Ly Change-Id: I04750e25f4b01067418eb6123201e845c00ce8d8 --- src/TosaSerialize.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/TosaSerialize.cpp') diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index 3569893..9a6cf84 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -1238,26 +1238,21 @@ TosaSerializationOperator * TosaSerializationOperatorBuilder::build( mlir::Operation &op) const { std::string input_name = GetTensorName(op.getOperand(0)); + std::string scale_name = GetTensorName(op.getOperand(1)); + std::string offset_name = GetTensorName(op.getOperand(2)); + std::string border_name = GetTensorName(op.getOperand(3)); std::string output_name = GetTensorName(op.getResult(0)); - auto scale = getDenseI64ArrayAttr(op.getAttr("scale")); - ASSERT_VECTOR_LENGTH(scale, 4); - - auto offset = getDenseI64ArrayAttr(op.getAttr("offset")); - ASSERT_VECTOR_LENGTH(offset, 2); - - auto border = getDenseI64ArrayAttr(op.getAttr("border")); - ASSERT_VECTOR_LENGTH(border, 2); - auto mode_str = op.getAttr("mode").dyn_cast().getValue().str(); ResizeMode mode = ResizeModeStr2Enum(mode_str); - TosaResizeAttribute attribute(scale, offset, border, mode); + TosaResizeAttribute attribute({}, {}, {}, mode); TosaSerializationOperator *tyop = new TosaSerializationOperator( Op_RESIZE, Attribute_ResizeAttribute, &attribute, - std::vector{input_name}, + std::vector{input_name, scale_name, offset_name, + border_name}, std::vector{output_name}); return tyop; -- cgit v1.2.1