aboutsummaryrefslogtreecommitdiff
path: root/python/serializer/tosa_serializer.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/serializer/tosa_serializer.py')
-rw-r--r--python/serializer/tosa_serializer.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index 9658edf..e6ab3d0 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -407,12 +407,15 @@ class TosaSerializerTensor:
if isinstance(data, np.ndarray):
data = data.flatten().astype(fntype).tolist()
data = list(map(fntype, data))
- self.data = data
elif isinstance(data, list):
data = list(map(fntype, data))
- self.data = data
+ elif data is not None:
+ # Assume data is rank 0 data type
+ data = list(map(fntype, [data]))
else:
- self.data = None
+ data = None
+
+ self.data = data
# Filename for placeholder tensors. These get generated by the test generation
# process and are written to disk, but are considered input tensors by the