blob: 0575b2e8a80209b7a2314a227c572ec25d7c688a [file] [log] [blame]
Tim Hall79d07d22020-04-27 18:20:16 +01001# automatically generated by the FlatBuffers compiler, do not modify
2
3# namespace: tflite
4
5import flatbuffers
6
7class Int32Vector(object):
8 __slots__ = ['_tab']
9
10 @classmethod
11 def GetRootAsInt32Vector(cls, buf, offset):
12 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 x = Int32Vector()
14 x.Init(buf, n + offset)
15 return x
16
Dwight Lidman8a12da12021-07-19 13:43:05 +020017 @classmethod
18 def Int32VectorBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
19 return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
20
Tim Hall79d07d22020-04-27 18:20:16 +010021 # Int32Vector
22 def Init(self, buf, pos):
23 self._tab = flatbuffers.table.Table(buf, pos)
24
25 # Int32Vector
26 def Values(self, j):
27 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
28 if o != 0:
29 a = self._tab.Vector(o)
30 return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
31 return 0
32
33 # Int32Vector
34 def ValuesAsNumpy(self):
35 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
36 if o != 0:
37 return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
38 return 0
39
40 # Int32Vector
41 def ValuesLength(self):
42 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
43 if o != 0:
44 return self._tab.VectorLen(o)
45 return 0
46
Dwight Lidman8a12da12021-07-19 13:43:05 +020047 # Int32Vector
48 def ValuesIsNone(self):
49 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
50 return o == 0
51
Tim Hall79d07d22020-04-27 18:20:16 +010052def Int32VectorStart(builder): builder.StartObject(1)
53def Int32VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
54def Int32VectorStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
55def Int32VectorEnd(builder): return builder.EndObject()