aboutsummaryrefslogtreecommitdiff
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
parent485a11d8cb67c8062c632f0987cd31cedbe93d6d (diff)
downloadserialization_lib-e1072a9ed871fd474e7b09b7a74ae7be5f0a6f78.tar.gz
Rename FLOAT type to FP32
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I2cd6ae85f59fd62a62b7f03ae9667228b54e82db
-rw-r--r--include/tosa_generated.h6
-rw-r--r--python/serializer/tosa_serializer.py6
-rw-r--r--python/tosa/DType.py2
-rw-r--r--schema/tosa.fbs2
4 files changed, 8 insertions, 8 deletions
diff --git a/include/tosa_generated.h b/include/tosa_generated.h
index f0d04d0..2b9d0ea 100644
--- a/include/tosa_generated.h
+++ b/include/tosa_generated.h
@@ -92,7 +92,7 @@ enum DType : uint32_t {
DType_INT16 = 5,
DType_INT32 = 6,
DType_INT48 = 7,
- DType_FLOAT = 8,
+ DType_FP32 = 8,
DType_UINT16 = 9,
DType_FP16 = 10,
DType_MIN = DType_UNKNOWN,
@@ -109,7 +109,7 @@ inline const DType (&EnumValuesDType())[11] {
DType_INT16,
DType_INT32,
DType_INT48,
- DType_FLOAT,
+ DType_FP32,
DType_UINT16,
DType_FP16
};
@@ -126,7 +126,7 @@ inline const char * const *EnumNamesDType() {
"INT16",
"INT32",
"INT48",
- "FLOAT",
+ "FP32",
"UINT16",
"FP16",
nullptr
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
diff --git a/schema/tosa.fbs b/schema/tosa.fbs
index b3ab991..eb76f75 100644
--- a/schema/tosa.fbs
+++ b/schema/tosa.fbs
@@ -29,7 +29,7 @@ enum DType:uint32 {
INT16,
INT32,
INT48,
- FLOAT,
+ FP32,
UINT16,
FP16,
}