Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | # namespace: tflite |
| 4 | |
| 5 | import flatbuffers |
| 6 | |
| 7 | class FullyConnectedOptions(object): |
| 8 | __slots__ = ['_tab'] |
| 9 | |
| 10 | @classmethod |
| 11 | def GetRootAsFullyConnectedOptions(cls, buf, offset): |
| 12 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 13 | x = FullyConnectedOptions() |
| 14 | x.Init(buf, n + offset) |
| 15 | return x |
| 16 | |
| 17 | # FullyConnectedOptions |
| 18 | def Init(self, buf, pos): |
| 19 | self._tab = flatbuffers.table.Table(buf, pos) |
| 20 | |
| 21 | # FullyConnectedOptions |
| 22 | def FusedActivationFunction(self): |
| 23 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 24 | if o != 0: |
| 25 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) |
| 26 | return 0 |
| 27 | |
| 28 | # FullyConnectedOptions |
| 29 | def WeightsFormat(self): |
| 30 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 31 | if o != 0: |
| 32 | return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) |
| 33 | return 0 |
| 34 | |
| 35 | # FullyConnectedOptions |
| 36 | def KeepNumDims(self): |
| 37 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 38 | if o != 0: |
| 39 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 40 | return False |
| 41 | |
Jacob Bohlin | 8daf6b7 | 2020-09-15 16:28:35 +0200 | [diff] [blame] | 42 | # FullyConnectedOptions |
| 43 | def AsymmetricQuantizeInputs(self): |
| 44 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 45 | if o != 0: |
| 46 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 47 | return False |
| 48 | |
| 49 | def FullyConnectedOptionsStart(builder): builder.StartObject(4) |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 50 | def FullyConnectedOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0) |
| 51 | def FullyConnectedOptionsAddWeightsFormat(builder, weightsFormat): builder.PrependInt8Slot(1, weightsFormat, 0) |
| 52 | def FullyConnectedOptionsAddKeepNumDims(builder, keepNumDims): builder.PrependBoolSlot(2, keepNumDims, 0) |
Jacob Bohlin | 8daf6b7 | 2020-09-15 16:28:35 +0200 | [diff] [blame] | 53 | def FullyConnectedOptionsAddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): builder.PrependBoolSlot(3, asymmetricQuantizeInputs, 0) |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 54 | def FullyConnectedOptionsEnd(builder): return builder.EndObject() |