From 1adc5d05d9fd21591790678a3f1cdaa4c5b347c4 Mon Sep 17 00:00:00 2001 From: Won Jeon Date: Sat, 12 Aug 2023 11:16:05 -0700 Subject: Add SHAPE data type to TOSA serialization Python code Signed-off-by: Won Jeon Change-Id: Iebeec3440fe6859e54d0d93de4cf7c704d2bcfe7 --- python/serializer/tosa_serializer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py index cc4c6bf..a1109d8 100644 --- a/python/serializer/tosa_serializer.py +++ b/python/serializer/tosa_serializer.py @@ -62,6 +62,7 @@ DTypeNames = [ "UINT16", "FP16", "BF16", + "SHAPE", ] ByteMask = np.uint64(0xFF) @@ -475,7 +476,7 @@ class TosaSerializerTensor: b2 = (val_u32 >> np.uint32(16)) & ByteMask b3 = (val_u32 >> np.uint32(24)) & ByteMask u8_data.extend([b0, b1, b2, b3]) - elif self.dtype == DType.INT48: + elif self.dtype == DType.INT48 or self.dtype == DType.SHAPE: for val in self.data: val_u64 = np.uint64(val) b0 = val_u64 & ByteMask -- cgit v1.2.1