1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class StablehloGatherOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = StablehloGatherOptions()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsStablehloGatherOptions(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def StablehloGatherOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# StablehloGatherOptions
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# StablehloGatherOptions
def OffsetDims(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
return 0
# StablehloGatherOptions
def OffsetDimsAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
return 0
# StablehloGatherOptions
def OffsetDimsLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# StablehloGatherOptions
def OffsetDimsIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
# StablehloGatherOptions
def CollapsedSliceDims(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
return 0
# StablehloGatherOptions
def CollapsedSliceDimsAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
return 0
# StablehloGatherOptions
def CollapsedSliceDimsLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.VectorLen(o)
return 0
# StablehloGatherOptions
def CollapsedSliceDimsIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
return o == 0
# StablehloGatherOptions
def StartIndexMap(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
return 0
# StablehloGatherOptions
def StartIndexMapAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
return 0
# StablehloGatherOptions
def StartIndexMapLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.VectorLen(o)
return 0
# StablehloGatherOptions
def StartIndexMapIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
return o == 0
# StablehloGatherOptions
def IndexVectorDim(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return 0
# StablehloGatherOptions
def SliceSizes(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
return 0
# StablehloGatherOptions
def SliceSizesAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
return 0
# StablehloGatherOptions
def SliceSizesLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.VectorLen(o)
return 0
# StablehloGatherOptions
def SliceSizesIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
return o == 0
# StablehloGatherOptions
def IndicesAreSorted(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
return False
def StablehloGatherOptionsStart(builder): builder.StartObject(6)
def Start(builder):
return StablehloGatherOptionsStart(builder)
def StablehloGatherOptionsAddOffsetDims(builder, offsetDims): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(offsetDims), 0)
def AddOffsetDims(builder, offsetDims):
return StablehloGatherOptionsAddOffsetDims(builder, offsetDims)
def StablehloGatherOptionsStartOffsetDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartOffsetDimsVector(builder, numElems):
return StablehloGatherOptionsStartOffsetDimsVector(builder, numElems)
def StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(collapsedSliceDims), 0)
def AddCollapsedSliceDims(builder, collapsedSliceDims):
return StablehloGatherOptionsAddCollapsedSliceDims(builder, collapsedSliceDims)
def StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartCollapsedSliceDimsVector(builder, numElems):
return StablehloGatherOptionsStartCollapsedSliceDimsVector(builder, numElems)
def StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(startIndexMap), 0)
def AddStartIndexMap(builder, startIndexMap):
return StablehloGatherOptionsAddStartIndexMap(builder, startIndexMap)
def StablehloGatherOptionsStartStartIndexMapVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartStartIndexMapVector(builder, numElems):
return StablehloGatherOptionsStartStartIndexMapVector(builder, numElems)
def StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim): builder.PrependInt64Slot(3, indexVectorDim, 0)
def AddIndexVectorDim(builder, indexVectorDim):
return StablehloGatherOptionsAddIndexVectorDim(builder, indexVectorDim)
def StablehloGatherOptionsAddSliceSizes(builder, sliceSizes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(sliceSizes), 0)
def AddSliceSizes(builder, sliceSizes):
return StablehloGatherOptionsAddSliceSizes(builder, sliceSizes)
def StablehloGatherOptionsStartSliceSizesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartSliceSizesVector(builder, numElems):
return StablehloGatherOptionsStartSliceSizesVector(builder, numElems)
def StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted): builder.PrependBoolSlot(5, indicesAreSorted, 0)
def AddIndicesAreSorted(builder, indicesAreSorted):
return StablehloGatherOptionsAddIndicesAreSorted(builder, indicesAreSorted)
def StablehloGatherOptionsEnd(builder): return builder.EndObject()
def End(builder):
return StablehloGatherOptionsEnd(builder)
|