aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite/QuantizationParameters.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/tflite/QuantizationParameters.py')
-rw-r--r--ethosu/vela/tflite/QuantizationParameters.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/ethosu/vela/tflite/QuantizationParameters.py b/ethosu/vela/tflite/QuantizationParameters.py
index fcd686cf..50acb835 100644
--- a/ethosu/vela/tflite/QuantizationParameters.py
+++ b/ethosu/vela/tflite/QuantizationParameters.py
@@ -3,6 +3,8 @@
# namespace: tflite
import flatbuffers
+from flatbuffers.compat import import_numpy
+np = import_numpy()
class QuantizationParameters(object):
__slots__ = ['_tab']
@@ -14,6 +16,10 @@ class QuantizationParameters(object):
x.Init(buf, n + offset)
return x
+ @classmethod
+ def QuantizationParametersBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
+ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
+
# QuantizationParameters
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
@@ -41,6 +47,11 @@ class QuantizationParameters(object):
return 0
# QuantizationParameters
+ def MinIsNone(self):
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+ return o == 0
+
+ # QuantizationParameters
def Max(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
@@ -63,6 +74,11 @@ class QuantizationParameters(object):
return 0
# QuantizationParameters
+ def MaxIsNone(self):
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+ return o == 0
+
+ # QuantizationParameters
def Scale(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
@@ -85,6 +101,11 @@ class QuantizationParameters(object):
return 0
# QuantizationParameters
+ def ScaleIsNone(self):
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+ return o == 0
+
+ # QuantizationParameters
def ZeroPoint(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
@@ -107,6 +128,11 @@ class QuantizationParameters(object):
return 0
# QuantizationParameters
+ def ZeroPointIsNone(self):
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+ return o == 0
+
+ # QuantizationParameters
def DetailsType(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0: