aboutsummaryrefslogtreecommitdiff
path: root/python
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
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')
-rw-r--r--python/serializer/tosa_serializer.py6
-rw-r--r--python/tosa/DType.py2
2 files changed, 4 insertions, 4 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]])
diff --git a/python/tosa/DType.py b/python/tosa/DType.py
index 27d28c4..89669b7 100644
--- a/python/tosa/DType.py
+++ b/python/tosa/DType.py
@@ -11,6 +11,6 @@ class DType(object):
INT16 = 5
INT32 = 6
INT48 = 7
- FLOAT = 8
+ FP32 = 8
UINT16 = 9
FP16 = 10