aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2023-06-20 14:57:58 -0700
committerJerry Ge <jerry.ge@arm.com>2023-06-20 17:29:51 -0700
commit9121c479ef2b11b52d7e77dc1b4dccd8f55b0db0 (patch)
tree4d34420332944631867346911a377ac451025b6e
parent9c5d418b13662e448520f16876b174d4b2a751e8 (diff)
downloadtosa_mlir_translator-9121c479ef2b11b52d7e77dc1b4dccd8f55b0db0.tar.gz
Add INT4 support for ConstOp deserialization
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ie5687f9eda2208e86a5d1d50d073d59edf434524
-rw-r--r--src/TosaDeserialize.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/TosaDeserialize.cpp b/src/TosaDeserialize.cpp
index ab60a26..d55585e 100644
--- a/src/TosaDeserialize.cpp
+++ b/src/TosaDeserialize.cpp
@@ -425,6 +425,13 @@ TosaMlirOperatorBuilder::build<Op_CONST>(TosaSerializationOperator *op) const {
mlir::DenseElementsAttr::get(output_type, llvm::ArrayRef(float_data));
break;
}
+ case DType_INT4: {
+ std::vector<int8_t> int4_data;
+ TosaSerializationHandler::ConvertU8toI4(data, out_size, int4_data);
+ value_attr =
+ mlir::DenseElementsAttr::get(output_type, llvm::ArrayRef(int4_data));
+ break;
+ }
case DType_INT8: {
std::vector<int8_t> int8_data;
TosaSerializationHandler::ConvertU8toI8(data, out_size, int8_data);