Module tflite.OperatorCode
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 OperatorCode(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = OperatorCode()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsOperatorCode(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def OperatorCodeBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
# OperatorCode
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# OperatorCode
def DeprecatedBuiltinCode(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 0
# OperatorCode
def CustomCode(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# OperatorCode
def Version(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 1
# OperatorCode
def BuiltinCode(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 0
def OperatorCodeStart(builder): builder.StartObject(4)
def Start(builder):
return OperatorCodeStart(builder)
def OperatorCodeAddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode): builder.PrependInt8Slot(0, deprecatedBuiltinCode, 0)
def AddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode):
return OperatorCodeAddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode)
def OperatorCodeAddCustomCode(builder, customCode): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(customCode), 0)
def AddCustomCode(builder, customCode):
return OperatorCodeAddCustomCode(builder, customCode)
def OperatorCodeAddVersion(builder, version): builder.PrependInt32Slot(2, version, 1)
def AddVersion(builder, version):
return OperatorCodeAddVersion(builder, version)
def OperatorCodeAddBuiltinCode(builder, builtinCode): builder.PrependInt32Slot(3, builtinCode, 0)
def AddBuiltinCode(builder, builtinCode):
return OperatorCodeAddBuiltinCode(builder, builtinCode)
def OperatorCodeEnd(builder): return builder.EndObject()
def End(builder):
return OperatorCodeEnd(builder)
Functions
def AddBuiltinCode(builder, builtinCode)
-
Expand source code
def AddBuiltinCode(builder, builtinCode): return OperatorCodeAddBuiltinCode(builder, builtinCode)
def AddCustomCode(builder, customCode)
-
Expand source code
def AddCustomCode(builder, customCode): return OperatorCodeAddCustomCode(builder, customCode)
def AddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode)
-
Expand source code
def AddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode): return OperatorCodeAddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode)
def AddVersion(builder, version)
-
Expand source code
def AddVersion(builder, version): return OperatorCodeAddVersion(builder, version)
def End(builder)
-
Expand source code
def End(builder): return OperatorCodeEnd(builder)
def OperatorCodeAddBuiltinCode(builder, builtinCode)
-
Expand source code
def OperatorCodeAddBuiltinCode(builder, builtinCode): builder.PrependInt32Slot(3, builtinCode, 0)
def OperatorCodeAddCustomCode(builder, customCode)
-
Expand source code
def OperatorCodeAddCustomCode(builder, customCode): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(customCode), 0)
def OperatorCodeAddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode)
-
Expand source code
def OperatorCodeAddDeprecatedBuiltinCode(builder, deprecatedBuiltinCode): builder.PrependInt8Slot(0, deprecatedBuiltinCode, 0)
def OperatorCodeAddVersion(builder, version)
-
Expand source code
def OperatorCodeAddVersion(builder, version): builder.PrependInt32Slot(2, version, 1)
def OperatorCodeEnd(builder)
-
Expand source code
def OperatorCodeEnd(builder): return builder.EndObject()
def OperatorCodeStart(builder)
-
Expand source code
def OperatorCodeStart(builder): builder.StartObject(4)
def Start(builder)
-
Expand source code
def Start(builder): return OperatorCodeStart(builder)
Classes
class OperatorCode
-
Expand source code
class OperatorCode(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = OperatorCode() x.Init(buf, n + offset) return x @classmethod def GetRootAsOperatorCode(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset) @classmethod def OperatorCodeBufferHasIdentifier(cls, buf, offset, size_prefixed=False): return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed) # OperatorCode def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # OperatorCode def DeprecatedBuiltinCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) return 0 # OperatorCode def CustomCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.String(o + self._tab.Pos) return None # OperatorCode def Version(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) return 1 # OperatorCode def BuiltinCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) return 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 = OperatorCode() x.Init(buf, n + offset) return x
def GetRootAsOperatorCode(buf, offset=0)
-
This method is deprecated. Please switch to GetRootAs.
Expand source code
@classmethod def GetRootAsOperatorCode(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset)
def OperatorCodeBufferHasIdentifier(buf, offset, size_prefixed=False)
-
Expand source code
@classmethod def OperatorCodeBufferHasIdentifier(cls, buf, offset, size_prefixed=False): return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
Methods
def BuiltinCode(self)
-
Expand source code
def BuiltinCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) return 0
def CustomCode(self)
-
Expand source code
def CustomCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.String(o + self._tab.Pos) return None
def DeprecatedBuiltinCode(self)
-
Expand source code
def DeprecatedBuiltinCode(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) return 0
def Init(self, buf, pos)
-
Expand source code
def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos)
def Version(self)
-
Expand source code
def Version(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) return 1