|
| 1 | +# automatically generated by the FlatBuffers compiler, do not modify |
| 2 | + |
| 3 | +# namespace: tflite |
| 4 | + |
| 5 | +import flatbuffers |
| 6 | +from flatbuffers.compat import import_numpy |
| 7 | +np = import_numpy() |
| 8 | + |
| 9 | +class BidirectionalSequenceLSTMOptions(object): |
| 10 | + __slots__ = ['_tab'] |
| 11 | + |
| 12 | + @classmethod |
| 13 | + def GetRootAsBidirectionalSequenceLSTMOptions(cls, buf, offset): |
| 14 | + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 15 | + x = BidirectionalSequenceLSTMOptions() |
| 16 | + x.Init(buf, n + offset) |
| 17 | + return x |
| 18 | + |
| 19 | + @classmethod |
| 20 | + def BidirectionalSequenceLSTMOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
| 21 | + return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) |
| 22 | + |
| 23 | + # BidirectionalSequenceLSTMOptions |
| 24 | + def Init(self, buf, pos): |
| 25 | + self._tab = flatbuffers.table.Table(buf, pos) |
| 26 | + |
| 27 | + # BidirectionalSequenceLSTMOptions |
| 28 | + def FusedActivationFunction(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.Int8Flags, o + self._tab.Pos) |
| 32 | + return 0 |
| 33 | + |
| 34 | + # BidirectionalSequenceLSTMOptions |
| 35 | + def CellClip(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.Float32Flags, o + self._tab.Pos) |
| 39 | + return 0.0 |
| 40 | + |
| 41 | + # BidirectionalSequenceLSTMOptions |
| 42 | + def ProjClip(self): |
| 43 | + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 44 | + if o != 0: |
| 45 | + return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) |
| 46 | + return 0.0 |
| 47 | + |
| 48 | + # BidirectionalSequenceLSTMOptions |
| 49 | + def MergeOutputs(self): |
| 50 | + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 51 | + if o != 0: |
| 52 | + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 53 | + return False |
| 54 | + |
| 55 | + # BidirectionalSequenceLSTMOptions |
| 56 | + def TimeMajor(self): |
| 57 | + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| 58 | + if o != 0: |
| 59 | + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 60 | + return True |
| 61 | + |
| 62 | + # BidirectionalSequenceLSTMOptions |
| 63 | + def AsymmetricQuantizeInputs(self): |
| 64 | + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) |
| 65 | + if o != 0: |
| 66 | + return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 67 | + return False |
| 68 | + |
| 69 | +def BidirectionalSequenceLSTMOptionsStart(builder): builder.StartObject(6) |
| 70 | +def BidirectionalSequenceLSTMOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0) |
| 71 | +def BidirectionalSequenceLSTMOptionsAddCellClip(builder, cellClip): builder.PrependFloat32Slot(1, cellClip, 0.0) |
| 72 | +def BidirectionalSequenceLSTMOptionsAddProjClip(builder, projClip): builder.PrependFloat32Slot(2, projClip, 0.0) |
| 73 | +def BidirectionalSequenceLSTMOptionsAddMergeOutputs(builder, mergeOutputs): builder.PrependBoolSlot(3, mergeOutputs, 0) |
| 74 | +def BidirectionalSequenceLSTMOptionsAddTimeMajor(builder, timeMajor): builder.PrependBoolSlot(4, timeMajor, 1) |
| 75 | +def BidirectionalSequenceLSTMOptionsAddAsymmetricQuantizeInputs(builder, asymmetricQuantizeInputs): builder.PrependBoolSlot(5, asymmetricQuantizeInputs, 0) |
| 76 | +def BidirectionalSequenceLSTMOptionsEnd(builder): return builder.EndObject() |
0 commit comments