blob: e70851b26d4b0b931eab36e91a0253037a5a3e64 [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
17 # Int32Vector
18 def Init(self, buf, pos):
19 self._tab = flatbuffers.table.Table(buf, pos)
20
21 # Int32Vector
22 def Values(self, j):
23 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24 if o != 0:
25 a = self._tab.Vector(o)
26 return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
27 return 0
28
29 # Int32Vector
30 def ValuesAsNumpy(self):
31 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
32 if o != 0:
33 return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
34 return 0
35
36 # Int32Vector
37 def ValuesLength(self):
38 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
39 if o != 0:
40 return self._tab.VectorLen(o)
41 return 0
42
43def Int32VectorStart(builder): builder.StartObject(1)
44def Int32VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
45def Int32VectorStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
46def Int32VectorEnd(builder): return builder.EndObject()