blob: 750e52a44f02d7f8bf2d675c4e9e7f99ece27df0 [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 Uint16Vector(object):
8 __slots__ = ['_tab']
9
10 @classmethod
11 def GetRootAsUint16Vector(cls, buf, offset):
12 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 x = Uint16Vector()
14 x.Init(buf, n + offset)
15 return x
16
17 # Uint16Vector
18 def Init(self, buf, pos):
19 self._tab = flatbuffers.table.Table(buf, pos)
20
21 # Uint16Vector
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.Uint16Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 2))
27 return 0
28
29 # Uint16Vector
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.Uint16Flags, o)
34 return 0
35
36 # Uint16Vector
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 Uint16VectorStart(builder): builder.StartObject(1)
44def Uint16VectorAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
45def Uint16VectorStartValuesVector(builder, numElems): return builder.StartVector(2, numElems, 2)
46def Uint16VectorEnd(builder): return builder.EndObject()