aboutsummaryrefslogtreecommitdiff
path: root/python/serializer/tosa_serializer.py
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2022-09-27 12:44:11 +0100
committerJeremy Johnson <jeremy.johnson@arm.com>2022-10-04 16:17:58 +0100
commite1072a9ed871fd474e7b09b7a74ae7be5f0a6f78 (patch)
tree23894142d5bf258dfa8c8b475f380be1e6e4eb66 /python/serializer/tosa_serializer.py
parent485a11d8cb67c8062c632f0987cd31cedbe93d6d (diff)
downloadserialization_lib-e1072a9ed871fd474e7b09b7a74ae7be5f0a6f78.tar.gz
Rename FLOAT type to FP32
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I2cd6ae85f59fd62a62b7f03ae9667228b54e82db
Diffstat (limited to 'python/serializer/tosa_serializer.py')
-rw-r--r--python/serializer/tosa_serializer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index fb89563..f4e146c 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -56,7 +56,7 @@ DTypeNames = [
"INT16",
"INT32",
"INT48",
- "FLOAT",
+ "FP32",
"UINT16",
"FP16",
]
@@ -378,7 +378,7 @@ class TosaSerializerTensor:
self.shape = shape
self.dtype = dtype
- if dtype == DType.FLOAT:
+ if dtype == DType.FP32:
fntype = np.float32
elif dtype == DType.FP16:
fntype = np.float16
@@ -466,7 +466,7 @@ class TosaSerializerTensor:
elif self.dtype == DType.FP16:
np_arr = np.array(self.data, dtype=np.float16)
u8_data.extend(np_arr.view(np.uint8))
- elif self.dtype == DType.FLOAT:
+ elif self.dtype == DType.FP32:
for val in self.data:
b = struct.pack("!f", val)
u8_data.extend([b[3], b[2], b[1], b[0]])