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 StablehloGatherOptions(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 = StablehloGatherOptions() |
| 16 | x.Init(buf, n + offset) |
| 17 | return x |
| 18 | |
| 19 | @classmethod |
| 20 | def GetRootAsStablehloGatherOptions(cls, buf, offset=0): |
| 21 | """This method is deprecated. Please switch to GetRootAs.""" |
| 22 | return cls.GetRootAs(buf, offset) |
| 23 | @classmethod |
| 24 | def StablehloGatherOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
| 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) |
| 26 | |
| 27 | # StablehloGatherOptions |
| 28 | def Init(self, buf, pos): |
| 29 | self._tab = flatbuffers.table.Table(buf, pos) |
| 30 | |
| 31 | # StablehloGatherOptions |
| 32 | def OffsetDims(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 | # StablehloGatherOptions |
| 40 | def OffsetDimsAsNumpy(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 | # StablehloGatherOptions |
| 47 | def OffsetDimsLength(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 | # StablehloGatherOptions |
| 54 | def OffsetDimsIsNone(self): |
| 55 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 56 | return o == 0 |
| 57 | |
| 58 | # StablehloGatherOptions |
| 59 | def CollapsedSliceDims(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 | # StablehloGatherOptions |
| 67 | def CollapsedSliceDimsAsNumpy(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 | # StablehloGatherOptions |
| 74 | def CollapsedSliceDimsLength(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 | # StablehloGatherOptions |
| 81 | def CollapsedSliceDimsIsNone(self): |
| 82 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 83 | return o == 0 |
| 84 | |
| 85 | # StablehloGatherOptions |
| 86 | def StartIndexMap(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 | # StablehloGatherOptions |
| 94 | def StartIndexMapAsNumpy(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 | # StablehloGatherOptions |
| 101 | def StartIndexMapLength(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 | # StablehloGatherOptions |
| 108 | def StartIndexMapIsNone(self): |
| 109 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 110 | return o == 0 |
| 111 | |
| 112 | # StablehloGatherOptions |
| 113 | def IndexVectorDim(self): |
| 114 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 115 | if o != 0: |
| 116 | return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) |
| 117 | return 0 |
| 118 | |
| 119 | # StablehloGatherOptions |
| 120 | def SliceSizes(self, j): |
| 121 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| 122 | if o != 0: |
| 123 | a = self._tab.Vector(o) |
| 124 | return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8)) |
| 125 | return 0 |
| 126 | |
| 127 | # StablehloGatherOptions |
| 128 | def SliceSizesAsNumpy(self): |
| 129 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| 130 | if o != 0: |
| 131 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o) |
| 132 | return 0 |
| 133 | |
| 134 | # StablehloGatherOptions |
| 135 | def SliceSizesLength(self): |
| 136 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| 137 | if o != 0: |
| 138 | return self._tab.VectorLen(o) |
| 139 | return 0 |
| 140 | |
| 141 | # StablehloGatherOptions |
| 142 | def SliceSizesIsNone(self): |
| 143 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) |
| 144 | return o == 0 |
| 145 | |
| 146 | # StablehloGatherOptions |
| 147 | def IndicesAreSorted(self): |
| 148 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) |
| 149 | if o != 0: |
| 150 | return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) |
| 151 | return False |
| 152 | |
| 153 | def StablehloGatherOptionsStart(builder): builder.StartObject(6) |
| 154 | def Start(builder): |
| 155 | return StablehloGatherOptionsStart(builder) |
| 156 | def StablehloGatherOptionsAddOffsetDims(builder, offsetDims): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(offsetDims), 0) |
| 157 | def AddOffsetDims(builder, offsetDims): |
| 158 | return StablehloGatherOptionsAddOffsetDims(builder, offsetDims) |
| 159 | def StablehloGatherOptionsStartOffsetDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 160 | def StartOffsetDimsVector(builder, numElems): |
| 161 | return StablehloGatherOptionsStartOffsetDimsVector(builder, numElems) |
| 162 | def StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(collapsedSliceDims), 0) |
| 163 | def AddCollapsedSliceDims(builder, collapsedSliceDims): |
| 164 | return StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims) |
| 165 | def StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 166 | def StartCollapsedSliceDimsVector(builder, numElems): |
| 167 | return StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems) |
| 168 | def StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(startIndexMap), 0) |
| 169 | def AddStartIndexMap(builder, startIndexMap): |
| 170 | return StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap) |
| 171 | def StablehloGatherOptionsStartStartIndexMapVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 172 | def StartStartIndexMapVector(builder, numElems): |
| 173 | return StablehloGatherOptionsStartStartIndexMapVector(builder, numElems) |
| 174 | def StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim): builder.PrependInt64Slot(3, indexVectorDim, 0) |
| 175 | def AddIndexVectorDim(builder, indexVectorDim): |
| 176 | return StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim) |
| 177 | def StablehloGatherOptionsAddSliceSizes(builder, sliceSizes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(sliceSizes), 0) |
| 178 | def AddSliceSizes(builder, sliceSizes): |
| 179 | return StablehloGatherOptionsAddSliceSizes(builder, sliceSizes) |
| 180 | def StablehloGatherOptionsStartSliceSizesVector(builder, numElems): return builder.StartVector(8, numElems, 8) |
| 181 | def StartSliceSizesVector(builder, numElems): |
| 182 | return StablehloGatherOptionsStartSliceSizesVector(builder, numElems) |
| 183 | def StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted): builder.PrependBoolSlot(5, indicesAreSorted, 0) |
| 184 | def AddIndicesAreSorted(builder, indicesAreSorted): |
| 185 | return StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted) |
| 186 | def StablehloGatherOptionsEnd(builder): return builder.EndObject() |
| 187 | def End(builder): |
| 188 | return StablehloGatherOptionsEnd(builder) |