Module tflite.StablehloSliceOptions

Functions

def AddLimitIndices(builder, limitIndices)
Expand source code
def AddLimitIndices(builder, limitIndices):
    StablehloSliceOptionsAddLimitIndices(builder, limitIndices)
def AddStartIndices(builder, startIndices)
Expand source code
def AddStartIndices(builder, startIndices):
    StablehloSliceOptionsAddStartIndices(builder, startIndices)
def AddStrides(builder, strides)
Expand source code
def AddStrides(builder, strides):
    StablehloSliceOptionsAddStrides(builder, strides)
def End(builder)
Expand source code
def End(builder):
    return StablehloSliceOptionsEnd(builder)
def StablehloSliceOptionsAddLimitIndices(builder, limitIndices)
Expand source code
def StablehloSliceOptionsAddLimitIndices(builder, limitIndices):
    builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(limitIndices), 0)
def StablehloSliceOptionsAddStartIndices(builder, startIndices)
Expand source code
def StablehloSliceOptionsAddStartIndices(builder, startIndices):
    builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(startIndices), 0)
def StablehloSliceOptionsAddStrides(builder, strides)
Expand source code
def StablehloSliceOptionsAddStrides(builder, strides):
    builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(strides), 0)
def StablehloSliceOptionsEnd(builder)
Expand source code
def StablehloSliceOptionsEnd(builder):
    return builder.EndObject()
def StablehloSliceOptionsStart(builder)
Expand source code
def StablehloSliceOptionsStart(builder):
    builder.StartObject(3)
def StablehloSliceOptionsStartLimitIndicesVector(builder, numElems)
Expand source code
def StablehloSliceOptionsStartLimitIndicesVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)
def StablehloSliceOptionsStartStartIndicesVector(builder, numElems)
Expand source code
def StablehloSliceOptionsStartStartIndicesVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)
def StablehloSliceOptionsStartStridesVector(builder, numElems)
Expand source code
def StablehloSliceOptionsStartStridesVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)
def Start(builder)
Expand source code
def Start(builder):
    StablehloSliceOptionsStart(builder)
def StartLimitIndicesVector(builder, numElems)
Expand source code
def StartLimitIndicesVector(builder, numElems):
    return StablehloSliceOptionsStartLimitIndicesVector(builder, numElems)
def StartStartIndicesVector(builder, numElems)
Expand source code
def StartStartIndicesVector(builder, numElems):
    return StablehloSliceOptionsStartStartIndicesVector(builder, numElems)
def StartStridesVector(builder, numElems)
Expand source code
def StartStridesVector(builder, numElems):
    return StablehloSliceOptionsStartStridesVector(builder, numElems)

Classes

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

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

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

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

    # StablehloSliceOptions
    def StartIndices(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.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloSliceOptions
    def StartIndicesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloSliceOptions
    def StartIndicesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloSliceOptions
    def StartIndicesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # StablehloSliceOptions
    def LimitIndices(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloSliceOptions
    def LimitIndicesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloSliceOptions
    def LimitIndicesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloSliceOptions
    def LimitIndicesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # StablehloSliceOptions
    def Strides(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # StablehloSliceOptions
    def StridesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # StablehloSliceOptions
    def StridesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # StablehloSliceOptions
    def StridesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

Static methods

def GetRootAs(buf, offset=0)
def GetRootAsStablehloSliceOptions(buf, offset=0)

This method is deprecated. Please switch to GetRootAs.

def StablehloSliceOptionsBufferHasIdentifier(buf, offset, size_prefixed=False)

Methods

def Init(self, buf, pos)
Expand source code
def Init(self, buf, pos):
    self._tab = flatbuffers.table.Table(buf, pos)
def LimitIndices(self, j)
Expand source code
def LimitIndices(self, j):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
    if o != 0:
        a = self._tab.Vector(o)
        return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
    return 0
def LimitIndicesAsNumpy(self)
Expand source code
def LimitIndicesAsNumpy(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
    if o != 0:
        return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
    return 0
def LimitIndicesIsNone(self)
Expand source code
def LimitIndicesIsNone(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
    return o == 0
def LimitIndicesLength(self)
Expand source code
def LimitIndicesLength(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
    if o != 0:
        return self._tab.VectorLen(o)
    return 0
def StartIndices(self, j)
Expand source code
def StartIndices(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.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
    return 0
def StartIndicesAsNumpy(self)
Expand source code
def StartIndicesAsNumpy(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
    if o != 0:
        return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
    return 0
def StartIndicesIsNone(self)
Expand source code
def StartIndicesIsNone(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
    return o == 0
def StartIndicesLength(self)
Expand source code
def StartIndicesLength(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
    if o != 0:
        return self._tab.VectorLen(o)
    return 0
def Strides(self, j)
Expand source code
def Strides(self, j):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
    if o != 0:
        a = self._tab.Vector(o)
        return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
    return 0
def StridesAsNumpy(self)
Expand source code
def StridesAsNumpy(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
    if o != 0:
        return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
    return 0
def StridesIsNone(self)
Expand source code
def StridesIsNone(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
    return o == 0
def StridesLength(self)
Expand source code
def StridesLength(self):
    o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
    if o != 0:
        return self._tab.VectorLen(o)
    return 0