Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / tools / tflitefile_tool / tflite / Uint8Vector.py
1 # automatically generated by the FlatBuffers compiler, do not modify
2
3 # namespace: onert_tflite
4
5 import flatbuffers
6
7
8 class Uint8Vector(object):
9     __slots__ = ['_tab']
10
11     @classmethod
12     def GetRootAsUint8Vector(cls, buf, offset):
13         n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
14         x = Uint8Vector()
15         x.Init(buf, n + offset)
16         return x
17
18     # Uint8Vector
19     def Init(self, buf, pos):
20         self._tab = flatbuffers.table.Table(buf, pos)
21
22     # Uint8Vector
23     def Values(self, j):
24         o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
25         if o != 0:
26             a = self._tab.Vector(o)
27             return self._tab.Get(
28                 flatbuffers.number_types.Uint8Flags,
29                 a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
30         return 0
31
32     # Uint8Vector
33     def ValuesAsNumpy(self):
34         o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
35         if o != 0:
36             return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
37         return 0
38
39     # Uint8Vector
40     def ValuesLength(self):
41         o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
42         if o != 0:
43             return self._tab.VectorLen(o)
44         return 0
45
46
47 def Uint8VectorStart(builder):
48     builder.StartObject(1)
49
50
51 def Uint8VectorAddValues(builder, values):
52     builder.PrependUOffsetTRelativeSlot(
53         0, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
54
55
56 def Uint8VectorStartValuesVector(builder, numElems):
57     return builder.StartVector(1, numElems, 1)
58
59
60 def Uint8VectorEnd(builder):
61     return builder.EndObject()