aboutsummaryrefslogtreecommitdiff
path: root/python/tosa_serializer.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tosa_serializer.py')
-rw-r--r--python/tosa_serializer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/tosa_serializer.py b/python/tosa_serializer.py
index 6915c83..b11f9cd 100644
--- a/python/tosa_serializer.py
+++ b/python/tosa_serializer.py
@@ -60,6 +60,9 @@ DTypeNames = [
"FLOAT",
]
+# File identifier needs to be kept in sync with schema/tosa.fbs
+TOSA_GRAPH_IDENTIFIER = b"\x54\x4F\x53\x41"
+
ByteMask = np.uint64(0xFF)
@@ -713,7 +716,7 @@ class TosaSerializer:
TosaGraph.TosaGraphAddBlocks(builder, fbv_bb)
graph = TosaGraph.TosaGraphEnd(builder)
- self.builder.Finish(graph)
+ self.builder.Finish(graph, TOSA_GRAPH_IDENTIFIER)
return self.builder.Output()
def writeJson(self, tosa_filename):