From 8a12da19e247750770bd0c2465d3690c1fcd7316 Mon Sep 17 00:00:00 2001 From: Dwight Lidman Date: Mon, 19 Jul 2021 13:43:05 +0200 Subject: MLBEDSW-4854: Update to TensorFlow 2.5 This commit updates the flatbuffers generated code to comply with TensorFlow 2.5, as well as stripping away some legacy code. Signed-off-by: Dwight Lidman Change-Id: I01fe47ec2bde6e78fdde21ee1bc0a71f560c53ae --- ethosu/vela/tflite/SubGraph.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ethosu/vela/tflite/SubGraph.py') diff --git a/ethosu/vela/tflite/SubGraph.py b/ethosu/vela/tflite/SubGraph.py index eaa42fac..163124d6 100644 --- a/ethosu/vela/tflite/SubGraph.py +++ b/ethosu/vela/tflite/SubGraph.py @@ -3,6 +3,8 @@ # namespace: tflite import flatbuffers +from flatbuffers.compat import import_numpy +np = import_numpy() class SubGraph(object): __slots__ = ['_tab'] @@ -14,6 +16,10 @@ class SubGraph(object): x.Init(buf, n + offset) return x + @classmethod + def SubGraphBufferHasIdentifier(cls, buf, offset, size_prefixed=False): + return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) + # SubGraph def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) @@ -38,6 +44,11 @@ class SubGraph(object): return self._tab.VectorLen(o) return 0 + # SubGraph + def TensorsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + return o == 0 + # SubGraph def Inputs(self, j): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) @@ -60,6 +71,11 @@ class SubGraph(object): return self._tab.VectorLen(o) return 0 + # SubGraph + def InputsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + return o == 0 + # SubGraph def Outputs(self, j): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) @@ -82,6 +98,11 @@ class SubGraph(object): return self._tab.VectorLen(o) return 0 + # SubGraph + def OutputsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + return o == 0 + # SubGraph def Operators(self, j): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) @@ -102,6 +123,11 @@ class SubGraph(object): return self._tab.VectorLen(o) return 0 + # SubGraph + def OperatorsIsNone(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + return o == 0 + # SubGraph def Name(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) -- cgit v1.2.1