blob: e2668c1d502d22ebb4001b29ac2544c59fbec61c [file] [log] [blame]
William Isakssonf4a511f2023-11-22 22:27:58 +01001# automatically generated by the FlatBuffers compiler, do not modify
2
3# namespace: tflite
4
5import flatbuffers
6from flatbuffers.compat import import_numpy
7np = import_numpy()
8
9class 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
153def StablehloGatherOptionsStart(builder): builder.StartObject(6)
154def Start(builder):
155 return StablehloGatherOptionsStart(builder)
156def StablehloGatherOptionsAddOffsetDims(builder, offsetDims): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(offsetDims), 0)
157def AddOffsetDims(builder, offsetDims):
158 return StablehloGatherOptionsAddOffsetDims(builder, offsetDims)
159def StablehloGatherOptionsStartOffsetDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
160def StartOffsetDimsVector(builder, numElems):
161 return StablehloGatherOptionsStartOffsetDimsVector(builder, numElems)
162def StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(collapsedSliceDims), 0)
163def AddCollapsedSliceDims(builder, collapsedSliceDims):
164 return StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims)
165def StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
166def StartCollapsedSliceDimsVector(builder, numElems):
167 return StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems)
168def StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(startIndexMap), 0)
169def AddStartIndexMap(builder, startIndexMap):
170 return StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap)
171def StablehloGatherOptionsStartStartIndexMapVector(builder, numElems): return builder.StartVector(8, numElems, 8)
172def StartStartIndexMapVector(builder, numElems):
173 return StablehloGatherOptionsStartStartIndexMapVector(builder, numElems)
174def StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim): builder.PrependInt64Slot(3, indexVectorDim, 0)
175def AddIndexVectorDim(builder, indexVectorDim):
176 return StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim)
177def StablehloGatherOptionsAddSliceSizes(builder, sliceSizes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(sliceSizes), 0)
178def AddSliceSizes(builder, sliceSizes):
179 return StablehloGatherOptionsAddSliceSizes(builder, sliceSizes)
180def StablehloGatherOptionsStartSliceSizesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
181def StartSliceSizesVector(builder, numElems):
182 return StablehloGatherOptionsStartSliceSizesVector(builder, numElems)
183def StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted): builder.PrependBoolSlot(5, indicesAreSorted, 0)
184def AddIndicesAreSorted(builder, indicesAreSorted):
185 return StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted)
186def StablehloGatherOptionsEnd(builder): return builder.EndObject()
187def End(builder):
188 return StablehloGatherOptionsEnd(builder)