Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 3 | # namespace: tosa |
| 4 | |
| 5 | import flatbuffers |
| 6 | from flatbuffers.compat import import_numpy |
| 7 | np = import_numpy() |
| 8 | |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 9 | class FullyConnectedAttribute(object): |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 10 | __slots__ = ['_tab'] |
| 11 | |
| 12 | @classmethod |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 13 | def GetRootAsFullyConnectedAttribute(cls, buf, offset): |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 15 | x = FullyConnectedAttribute() |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 16 | x.Init(buf, n + offset) |
| 17 | return x |
| 18 | |
| 19 | @classmethod |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 20 | def FullyConnectedAttributeBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 21 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x4F\x53\x41", size_prefixed=size_prefixed) |
| 22 | |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 23 | # FullyConnectedAttribute |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 24 | def Init(self, buf, pos): |
| 25 | self._tab = flatbuffers.table.Table(buf, pos) |
| 26 | |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 27 | # FullyConnectedAttribute |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 28 | def InputZp(self): |
| 29 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 30 | if o != 0: |
| 31 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) |
| 32 | return 0 |
| 33 | |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 34 | # FullyConnectedAttribute |
Eric Kunze | 2364dcd | 2021-04-26 11:06:57 -0700 | [diff] [blame] | 35 | def WeightZp(self): |
| 36 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 37 | if o != 0: |
| 38 | return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) |
| 39 | return 0 |
| 40 | |
Eric Kunze | bdcc3fe | 2022-06-07 05:17:37 +0000 | [diff] [blame^] | 41 | def FullyConnectedAttributeStart(builder): builder.StartObject(2) |
| 42 | def FullyConnectedAttributeAddInputZp(builder, inputZp): builder.PrependInt32Slot(0, inputZp, 0) |
| 43 | def FullyConnectedAttributeAddWeightZp(builder, weightZp): builder.PrependInt32Slot(1, weightZp, 0) |
| 44 | def FullyConnectedAttributeEnd(builder): return builder.EndObject() |