diff options
Diffstat (limited to 'src/TosaDeserialize.cpp')
-rw-r--r-- | src/TosaDeserialize.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/TosaDeserialize.cpp b/src/TosaDeserialize.cpp index 5ad7e6e..9660833 100644 --- a/src/TosaDeserialize.cpp +++ b/src/TosaDeserialize.cpp @@ -1174,9 +1174,6 @@ TosaMlirOperatorBuilder::build<Op_SLICE>(TosaSerializationOperator *op) const { mlir::RankedTensorType output_type = tensor_type_map->at(op->GetOutputTensorNames()[0]); - assert(op->GetAttributeType() == - Attribute_SliceAttribute); // double check attribute type - mlir::Value start = tensor_map->at(op->GetInputTensorNames()[1]); mlir::Value size = tensor_map->at(op->GetInputTensorNames()[2]); @@ -1336,6 +1333,8 @@ template <> std::vector<mlir::Value> TosaMlirOperatorBuilder::build<Op_RESCALE>( TosaSerializationOperator *op) const { mlir::Value input_val = tensor_map->at(op->GetInputTensorNames()[0]); + mlir::Value multiplier_val = tensor_map->at(op->GetInputTensorNames()[1]); + mlir::Value shift_val = tensor_map->at(op->GetInputTensorNames()[2]); mlir::RankedTensorType output_type = tensor_type_map->at(op->GetOutputTensorNames()[0]); @@ -1347,9 +1346,6 @@ std::vector<mlir::Value> TosaMlirOperatorBuilder::build<Op_RESCALE>( auto input_zp = op_builder->getI32IntegerAttr(attr->input_zp()); auto output_zp = op_builder->getI32IntegerAttr(attr->output_zp()); - auto multiplier = BuildDenseI32ArrayAttr(op_builder, attr->multiplier()); - auto shift = BuildDenseI8ArrayAttr(op_builder, attr->shift()); - auto scale32 = op_builder->getBoolAttr(attr->scale32()); auto double_round = op_builder->getBoolAttr(attr->double_round()); auto per_channel = op_builder->getBoolAttr(attr->per_channel()); @@ -1358,8 +1354,9 @@ std::vector<mlir::Value> TosaMlirOperatorBuilder::build<Op_RESCALE>( auto output_unsigned = op_builder->getBoolAttr(attr->output_unsigned()); mlir::Operation *mlir_op = op_builder->create<mlir::tosa::RescaleOp>( - loc, output_type, input_val, input_zp, output_zp, multiplier, shift, - scale32, double_round, per_channel, input_unsigned, output_unsigned); + loc, output_type, input_val, multiplier_val, shift_val, input_zp, + output_zp, scale32, double_round, per_channel, input_unsigned, + output_unsigned); block->push_back(mlir_op); return std::vector<mlir::Value>({mlir_op->getResult(0)}); } |