aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWon Jeon <won.jeon@arm.com>2023-08-12 11:16:05 -0700
committerWon Jeon <won.jeon@arm.com>2023-08-12 11:20:01 -0700
commit1adc5d05d9fd21591790678a3f1cdaa4c5b347c4 (patch)
tree7f49cd538bf3f6a92abf35129a52e258d3942f91
parentcb4bbf4fe49ec08b16c348b0db988199de789500 (diff)
downloadserialization_lib-1adc5d05d9fd21591790678a3f1cdaa4c5b347c4.tar.gz
Add SHAPE data type to TOSA serialization Python code
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Iebeec3440fe6859e54d0d93de4cf7c704d2bcfe7
-rw-r--r--python/serializer/tosa_serializer.py3
1 files changed, 2 insertions, 1 deletions
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