Module tflite.DimensionMetadata

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 DimensionMetadata(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = DimensionMetadata()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsDimensionMetadata(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def DimensionMetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)

    # DimensionMetadata
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # DimensionMetadata
    def Format(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

    # DimensionMetadata
    def DenseSize(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArraySegmentsType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArraySegments(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

    # DimensionMetadata
    def ArrayIndicesType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArrayIndices(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

def DimensionMetadataStart(builder): builder.StartObject(6)
def Start(builder):
    return DimensionMetadataStart(builder)
def DimensionMetadataAddFormat(builder, format): builder.PrependInt8Slot(0, format, 0)
def AddFormat(builder, format):
    return DimensionMetadataAddFormat(builder, format)
def DimensionMetadataAddDenseSize(builder, denseSize): builder.PrependInt32Slot(1, denseSize, 0)
def AddDenseSize(builder, denseSize):
    return DimensionMetadataAddDenseSize(builder, denseSize)
def DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType): builder.PrependUint8Slot(2, arraySegmentsType, 0)
def AddArraySegmentsType(builder, arraySegmentsType):
    return DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType)
def DimensionMetadataAddArraySegments(builder, arraySegments): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(arraySegments), 0)
def AddArraySegments(builder, arraySegments):
    return DimensionMetadataAddArraySegments(builder, arraySegments)
def DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType): builder.PrependUint8Slot(4, arrayIndicesType, 0)
def AddArrayIndicesType(builder, arrayIndicesType):
    return DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType)
def DimensionMetadataAddArrayIndices(builder, arrayIndices): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(arrayIndices), 0)
def AddArrayIndices(builder, arrayIndices):
    return DimensionMetadataAddArrayIndices(builder, arrayIndices)
def DimensionMetadataEnd(builder): return builder.EndObject()
def End(builder):
    return DimensionMetadataEnd(builder)

Functions

def AddArrayIndices(builder, arrayIndices)
Expand source code
def AddArrayIndices(builder, arrayIndices):
    return DimensionMetadataAddArrayIndices(builder, arrayIndices)
def AddArrayIndicesType(builder, arrayIndicesType)
Expand source code
def AddArrayIndicesType(builder, arrayIndicesType):
    return DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType)
def AddArraySegments(builder, arraySegments)
Expand source code
def AddArraySegments(builder, arraySegments):
    return DimensionMetadataAddArraySegments(builder, arraySegments)
def AddArraySegmentsType(builder, arraySegmentsType)
Expand source code
def AddArraySegmentsType(builder, arraySegmentsType):
    return DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType)
def AddDenseSize(builder, denseSize)
Expand source code
def AddDenseSize(builder, denseSize):
    return DimensionMetadataAddDenseSize(builder, denseSize)
def AddFormat(builder, format)
Expand source code
def AddFormat(builder, format):
    return DimensionMetadataAddFormat(builder, format)
def DimensionMetadataAddArrayIndices(builder, arrayIndices)
Expand source code
def DimensionMetadataAddArrayIndices(builder, arrayIndices): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(arrayIndices), 0)
def DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType)
Expand source code
def DimensionMetadataAddArrayIndicesType(builder, arrayIndicesType): builder.PrependUint8Slot(4, arrayIndicesType, 0)
def DimensionMetadataAddArraySegments(builder, arraySegments)
Expand source code
def DimensionMetadataAddArraySegments(builder, arraySegments): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(arraySegments), 0)
def DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType)
Expand source code
def DimensionMetadataAddArraySegmentsType(builder, arraySegmentsType): builder.PrependUint8Slot(2, arraySegmentsType, 0)
def DimensionMetadataAddDenseSize(builder, denseSize)
Expand source code
def DimensionMetadataAddDenseSize(builder, denseSize): builder.PrependInt32Slot(1, denseSize, 0)
def DimensionMetadataAddFormat(builder, format)
Expand source code
def DimensionMetadataAddFormat(builder, format): builder.PrependInt8Slot(0, format, 0)
def DimensionMetadataEnd(builder)
Expand source code
def DimensionMetadataEnd(builder): return builder.EndObject()
def DimensionMetadataStart(builder)
Expand source code
def DimensionMetadataStart(builder): builder.StartObject(6)
def End(builder)
Expand source code
def End(builder):
    return DimensionMetadataEnd(builder)
def Start(builder)
Expand source code
def Start(builder):
    return DimensionMetadataStart(builder)

Classes

class DimensionMetadata
Expand source code
class DimensionMetadata(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = DimensionMetadata()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsDimensionMetadata(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def DimensionMetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)

    # DimensionMetadata
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # DimensionMetadata
    def Format(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

    # DimensionMetadata
    def DenseSize(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArraySegmentsType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArraySegments(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

    # DimensionMetadata
    def ArrayIndicesType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # DimensionMetadata
    def ArrayIndices(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            from flatbuffers.table import Table
            obj = Table(bytearray(), 0)
            self._tab.Union(obj, o)
            return obj
        return None

Static methods

def DimensionMetadataBufferHasIdentifier(buf, offset, size_prefixed=False)
Expand source code
@classmethod
def DimensionMetadataBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
    return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x46\x4C\x33", size_prefixed=size_prefixed)
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 = DimensionMetadata()
    x.Init(buf, n + offset)
    return x
def GetRootAsDimensionMetadata(buf, offset=0)

This method is deprecated. Please switch to GetRootAs.

Expand source code
@classmethod
def GetRootAsDimensionMetadata(cls, buf, offset=0):
    """This method is deprecated. Please switch to GetRootAs."""
    return cls.GetRootAs(buf, offset)

Methods

def ArrayIndices(self)
Expand source code
def ArrayIndices(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
    if o != 0:
        from flatbuffers.table import Table
        obj = Table(bytearray(), 0)
        self._tab.Union(obj, o)
        return obj
    return None
def ArrayIndicesType(self)
Expand source code
def ArrayIndicesType(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
    if o != 0:
        return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
    return 0
def ArraySegments(self)
Expand source code
def ArraySegments(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
    if o != 0:
        from flatbuffers.table import Table
        obj = Table(bytearray(), 0)
        self._tab.Union(obj, o)
        return obj
    return None
def ArraySegmentsType(self)
Expand source code
def ArraySegmentsType(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
    if o != 0:
        return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
    return 0
def DenseSize(self)
Expand source code
def DenseSize(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
    if o != 0:
        return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
    return 0
def Format(self)
Expand source code
def Format(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)