aboutsummaryrefslogtreecommitdiff
path: root/python/tosa
diff options
context:
space:
mode:
authorLuke Hutton <luke.hutton@arm.com>2023-01-12 22:20:53 +0000
committerLuke Hutton <luke.hutton@arm.com>2023-01-13 10:34:25 +0000
commit5e268097917825ddaa00a86ee95a4a6c4f50124b (patch)
tree8cc0f3b0b7a1d8e68e192a4e243020dc69791c5f /python/tosa
parentca7ce0e94b3ee7339f31b47baa3a3fb4522243a2 (diff)
downloadserialization_lib-5e268097917825ddaa00a86ee95a4a6c4f50124b.tar.gz
Add FFT2d and RFFT2d serialization support
Signed-off-by: Luke Hutton <luke.hutton@arm.com> Change-Id: I79b3684ae1cf24e71ec7098ed7db5be5bc2f6fb2
Diffstat (limited to 'python/tosa')
-rw-r--r--python/tosa/Attribute.py1
-rw-r--r--python/tosa/FFTAttribute.py46
-rw-r--r--python/tosa/Op.py2
3 files changed, 49 insertions, 0 deletions
diff --git a/python/tosa/Attribute.py b/python/tosa/Attribute.py
index 7ada553..25ade44 100644
--- a/python/tosa/Attribute.py
+++ b/python/tosa/Attribute.py
@@ -25,3 +25,4 @@ class Attribute(object):
FullyConnectedAttribute = 19
NegateAttribute = 20
CustomAttribute = 21
+ FFTAttribute = 22
diff --git a/python/tosa/FFTAttribute.py b/python/tosa/FFTAttribute.py
new file mode 100644
index 0000000..3dd4083
--- /dev/null
+++ b/python/tosa/FFTAttribute.py
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tosa
+
+import flatbuffers
+from flatbuffers.compat import import_numpy
+np = import_numpy()
+
+class FFTAttribute(object):
+ __slots__ = ['_tab']
+
+ @classmethod
+ def GetRootAs(cls, buf, offset=0):
+ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+ x = FFTAttribute()
+ x.Init(buf, n + offset)
+ return x
+
+ @classmethod
+ def GetRootAsFFTAttribute(cls, buf, offset=0):
+ """This method is deprecated. Please switch to GetRootAs."""
+ return cls.GetRootAs(buf, offset)
+ @classmethod
+ def FFTAttributeBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
+ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x4F\x53\x41", size_prefixed=size_prefixed)
+
+ # FFTAttribute
+ def Init(self, buf, pos):
+ self._tab = flatbuffers.table.Table(buf, pos)
+
+ # FFTAttribute
+ def Inverse(self):
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+ if o != 0:
+ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
+ return False
+
+def FFTAttributeStart(builder): builder.StartObject(1)
+def Start(builder):
+ return FFTAttributeStart(builder)
+def FFTAttributeAddInverse(builder, inverse): builder.PrependBoolSlot(0, inverse, 0)
+def AddInverse(builder, inverse):
+ return FFTAttributeAddInverse(builder, inverse)
+def FFTAttributeEnd(builder): return builder.EndObject()
+def End(builder):
+ return FFTAttributeEnd(builder) \ No newline at end of file
diff --git a/python/tosa/Op.py b/python/tosa/Op.py
index 6b4c7b0..b8e68c0 100644
--- a/python/tosa/Op.py
+++ b/python/tosa/Op.py
@@ -72,3 +72,5 @@ class Op(object):
CUSTOM = 66
COND_IF = 67
WHILE_LOOP = 68
+ FFT2D = 69
+ RFFT2D = 70