Module tflite.ReshapeOptions
Expand source code
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class ReshapeOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = ReshapeOptions()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsReshapeOptions(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def ReshapeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# ReshapeOptions
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# ReshapeOptions
def NewShape(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0
# ReshapeOptions
def NewShapeAsNumpy(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
return 0
# ReshapeOptions
def NewShapeLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.VectorLen(o)
return 0
# ReshapeOptions
def NewShapeIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
return o == 0
def ReshapeOptionsStart(builder): builder.StartObject(1)
def Start(builder):
return ReshapeOptionsStart(builder)
def ReshapeOptionsAddNewShape(builder, newShape): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(newShape), 0)
def AddNewShape(builder, newShape):
return ReshapeOptionsAddNewShape(builder, newShape)
def ReshapeOptionsStartNewShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartNewShapeVector(builder, numElems):
return ReshapeOptionsStartNewShapeVector(builder, numElems)
def ReshapeOptionsEnd(builder): return builder.EndObject()
def End(builder):
return ReshapeOptionsEnd(builder)
Functions
def AddNewShape(builder, newShape)
-
Expand source code
def AddNewShape(builder, newShape): return ReshapeOptionsAddNewShape(builder, newShape)
def End(builder)
-
Expand source code
def End(builder): return ReshapeOptionsEnd(builder)
def ReshapeOptionsAddNewShape(builder, newShape)
-
Expand source code
def ReshapeOptionsAddNewShape(builder, newShape): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(newShape), 0)
def ReshapeOptionsEnd(builder)
-
Expand source code
def ReshapeOptionsEnd(builder): return builder.EndObject()
def ReshapeOptionsStart(builder)
-
Expand source code
def ReshapeOptionsStart(builder): builder.StartObject(1)
def ReshapeOptionsStartNewShapeVector(builder, numElems)
-
Expand source code
def ReshapeOptionsStartNewShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def Start(builder)
-
Expand source code
def Start(builder): return ReshapeOptionsStart(builder)
def StartNewShapeVector(builder, numElems)
-
Expand source code
def StartNewShapeVector(builder, numElems): return ReshapeOptionsStartNewShapeVector(builder, numElems)
Classes
class ReshapeOptions
-
Expand source code
class ReshapeOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = ReshapeOptions() x.Init(buf, n + offset) return x @classmethod def GetRootAsReshapeOptions(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset) @classmethod def ReshapeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) # ReshapeOptions def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # ReshapeOptions def NewShape(self, j): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: a = self._tab.Vector(o) return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) return 0 # ReshapeOptions def NewShapeAsNumpy(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) return 0 # ReshapeOptions def NewShapeLength(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.VectorLen(o) return 0 # ReshapeOptions def NewShapeIsNone(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) return o == 0
Static methods
def GetRootAs(buf, offset=0)
-
Expand source code
@classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = ReshapeOptions() x.Init(buf, n + offset) return x
def GetRootAsReshapeOptions(buf, offset=0)
-
This method is deprecated. Please switch to GetRootAs.
Expand source code
@classmethod def GetRootAsReshapeOptions(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset)
def ReshapeOptionsBufferHasIdentifier(buf, offset, size_prefixed=False)
-
Expand source code
@classmethod def ReshapeOptionsBufferHasIdentifier(cls, buf, offset, size_prefixed=False): return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
Methods
def Init(self, buf, pos)
-
Expand source code
def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos)
def NewShape(self, j)
-
Expand source code
def NewShape(self, j): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: a = self._tab.Vector(o) return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) return 0
def NewShapeAsNumpy(self)
-
Expand source code
def NewShapeAsNumpy(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) return 0
def NewShapeIsNone(self)
-
Expand source code
def NewShapeIsNone(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) return o == 0
def NewShapeLength(self)
-
Expand source code
def NewShapeLength(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.VectorLen(o) return 0