diff options
author | Tai Ly <tai.ly@arm.com> | 2024-02-22 22:22:24 +0000 |
---|---|---|
committer | Tai Ly <tai.ly@arm.com> | 2024-02-23 14:56:11 -0800 |
commit | 150bc9bcdea84f8c24a17d5f2fcb38128afe50ab (patch) | |
tree | f25ca6459504eee81c7a3b3a9022a846f481138b /src/TosaDeserialize.cpp | |
parent | 3bdc1904e7fef906f030ca61f81b1371ba528c0d (diff) | |
download | tosa_mlir_translator-150bc9bcdea84f8c24a17d5f2fcb38128afe50ab.tar.gz |
[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 <tai.ly@arm.com>
Change-Id: I04750e25f4b01067418eb6123201e845c00ce8d8
Diffstat (limited to 'src/TosaDeserialize.cpp')
-rw-r--r-- | src/TosaDeserialize.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/TosaDeserialize.cpp b/src/TosaDeserialize.cpp index 1dcd88d..1f24f71 100644 --- a/src/TosaDeserialize.cpp +++ b/src/TosaDeserialize.cpp @@ -1202,6 +1202,9 @@ template <> std::vector<mlir::Value> TosaMlirOperatorBuilder::build<Op_RESIZE>(TosaSerializationOperator *op) const { mlir::Value input_val = tensor_map->at(op->GetInputTensorNames()[0]); + mlir::Value scale_val = tensor_map->at(op->GetInputTensorNames()[1]); + mlir::Value offset_val = tensor_map->at(op->GetInputTensorNames()[2]); + mlir::Value border_val = tensor_map->at(op->GetInputTensorNames()[3]); mlir::RankedTensorType output_type = tensor_type_map->at(op->GetOutputTensorNames()[0]); @@ -1210,16 +1213,10 @@ TosaMlirOperatorBuilder::build<Op_RESIZE>(TosaSerializationOperator *op) const { TosaResizeAttribute *attr = static_cast<TosaResizeAttribute *>(op->GetAttribute()); - mlir::DenseI64ArrayAttr scale = - BuildDenseI64ArrayAttr(op_builder, attr->scale()); - mlir::DenseI64ArrayAttr offset = - BuildDenseI64ArrayAttr(op_builder, attr->offset()); - mlir::DenseI64ArrayAttr border = - BuildDenseI64ArrayAttr(op_builder, attr->border()); auto mode = op_builder->getStringAttr(ResizeEnum2Str(attr->mode())); mlir::Operation *mlir_op = op_builder->create<mlir::tosa::ResizeOp>( - loc, output_type, input_val, scale, offset, border, mode); + loc, output_type, input_val, scale_val, offset_val, border_val, mode); block->push_back(mlir_op); return std::vector<mlir::Value>({mlir_op->getResult(0)}); } |