1 # automatically generated by the FlatBuffers compiler, do not modify
3 # namespace: onert_tflite
8 class ReshapeOptions(object):
12 def GetRootAsReshapeOptions(cls, buf, offset):
13 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
15 x.Init(buf, n + offset)
19 def Init(self, buf, pos):
20 self._tab = flatbuffers.table.Table(buf, pos)
23 def NewShape(self, j):
24 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
26 a = self._tab.Vector(o)
28 flatbuffers.number_types.Int32Flags,
29 a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
33 def NewShapeAsNumpy(self):
34 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
36 return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
40 def NewShapeLength(self):
41 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
43 return self._tab.VectorLen(o)
47 def ReshapeOptionsStart(builder):
48 builder.StartObject(1)
51 def ReshapeOptionsAddNewShape(builder, newShape):
52 builder.PrependUOffsetTRelativeSlot(
53 0, flatbuffers.number_types.UOffsetTFlags.py_type(newShape), 0)
56 def ReshapeOptionsStartNewShapeVector(builder, numElems):
57 return builder.StartVector(4, numElems, 4)
60 def ReshapeOptionsEnd(builder):
61 return builder.EndObject()