William Isaksson | f4a511f | 2023-11-22 22:27:58 +0100 | [diff] [blame^] | 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 StablehloSliceOptions(object): |
| 10 | __slots__ = ['_tab'] |
| 11 | |
| 12 | @classmethod |
| 13 | def GetRootAs(cls, buf, offset=0): |
| 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 15 | x = StablehloSliceOptions() |
| 16 | x.Init(buf, n + offset) |
| 17 | return x |
| 18 | |
| 19 | @classmethod |
| 20 | def GetRootAsStablehloSliceOptions(cls, buf, offset=0): |
| 21 | """This method is deprecated. Please switch to GetRootAs.""" |
| 22 | return cls.GetRootAs(buf, offset) |
| 23 | @classmethod |
| 24 | def StablehloSliceOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
| 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) |
| 26 | |
| 27 | # StablehloSliceOptions |
| 28 | def Init(self, buf, pos): |
| 29 | self._tab = flatbuffers.table.Table(buf, pos) |
| 30 | |
| 31 | # StablehloSliceOptions |
| 32 | def StartIndices(self, j): |
| 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 34 | if o != 0: |
| 35 | a = self._tab.Vector(o) |
| 36 | return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) |
| 37 | return 0 |
| 38 | |
| 39 | # StablehloSliceOptions |
| 40 | def StartIndicesAsNumpy(self): |
| 41 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 42 | if o != 0: |
| 43 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) |
| 44 | return 0 |
| 45 | |
| 46 | # StablehloSliceOptions |
| 47 | def StartIndicesLength(self): |
| 48 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 49 | if o != 0: |
| 50 | return self._tab.VectorLen(o) |
| 51 | return 0 |
| 52 | |
| 53 | # StablehloSliceOptions |
| 54 | def StartIndicesIsNone(self): |
| 55 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 56 | return o == 0 |
| 57 | |
| 58 | # StablehloSliceOptions |
| 59 | def LimitIndices(self, j): |
| 60 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 61 | if o != 0: |
| 62 | a = self._tab.Vector(o) |
| 63 | return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) |
| 64 | return 0 |
| 65 | |
| 66 | # StablehloSliceOptions |
| 67 | def LimitIndicesAsNumpy(self): |
| 68 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 69 | if o != 0: |
| 70 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) |
| 71 | return 0 |
| 72 | |
| 73 | # StablehloSliceOptions |
| 74 | def LimitIndicesLength(self): |
| 75 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 76 | if o != 0: |
| 77 | return self._tab.VectorLen(o) |
| 78 | return 0 |
| 79 | |
| 80 | # StablehloSliceOptions |
| 81 | def LimitIndicesIsNone(self): |
| 82 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 83 | return o == 0 |
| 84 | |
| 85 | # StablehloSliceOptions |
| 86 | def Strides(self, j): |
| 87 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 88 | if o != 0: |
| 89 | a = self._tab.Vector(o) |
| 90 | return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) |
| 91 | return 0 |
| 92 | |
| 93 | # StablehloSliceOptions |
| 94 | def StridesAsNumpy(self): |
| 95 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 96 | if o != 0: |
| 97 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) |
| 98 | return 0 |
| 99 | |
| 100 | # StablehloSliceOptions |
| 101 | def StridesLength(self): |
| 102 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 103 | if o != 0: |
| 104 | return self._tab.VectorLen(o) |
| 105 | return 0 |
| 106 | |
| 107 | # StablehloSliceOptions |
| 108 | def StridesIsNone(self): |
| 109 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 110 | return o == 0 |
| 111 | |
| 112 | def StablehloSliceOptionsStart(builder): builder.StartObject(3) |
| 113 | def Start(builder): |
| 114 | return StablehloSliceOptionsStart(builder) |
| 115 | def StablehloSliceOptionsAddStartIndices(builder, startIndices): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(startIndices), 0) |
| 116 | def AddStartIndices(builder, startIndices): |
| 117 | return StablehloSliceOptionsAddStartIndices(builder, startIndices) |
| 118 | def StablehloSliceOptionsStartStartIndicesVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 119 | def StartStartIndicesVector(builder, numElems): |
| 120 | return StablehloSliceOptionsStartStartIndicesVector(builder, numElems) |
| 121 | def StablehloSliceOptionsAddLimitIndices(builder, limitIndices): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(limitIndices), 0) |
| 122 | def AddLimitIndices(builder, limitIndices): |
| 123 | return StablehloSliceOptionsAddLimitIndices(builder, limitIndices) |
| 124 | def StablehloSliceOptionsStartLimitIndicesVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 125 | def StartLimitIndicesVector(builder, numElems): |
| 126 | return StablehloSliceOptionsStartLimitIndicesVector(builder, numElems) |
| 127 | def StablehloSliceOptionsAddStrides(builder, strides): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(strides), 0) |
| 128 | def AddStrides(builder, strides): |
| 129 | return StablehloSliceOptionsAddStrides(builder, strides) |
| 130 | def StablehloSliceOptionsStartStridesVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 131 | def StartStridesVector(builder, numElems): |
| 132 | return StablehloSliceOptionsStartStridesVector(builder, numElems) |
| 133 | def StablehloSliceOptionsEnd(builder): return builder.EndObject() |
| 134 | def End(builder): |
| 135 | return StablehloSliceOptionsEnd(builder) |