# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Gather(object):
    __slots__ = ['_tab']

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

    @classmethod
    def GetRootAsGather(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # Gather
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

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

    # Gather
    def Tparams(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

    # Gather
    def ValidateIndices(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # Gather
    def Axis(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 GatherStart(builder): builder.StartObject(4)
def Start(builder):
    return GatherStart(builder)
def GatherAddTindices(builder, tindices): builder.PrependInt32Slot(0, tindices, 0)
def AddTindices(builder, tindices):
    return GatherAddTindices(builder, tindices)
def GatherAddTparams(builder, tparams): builder.PrependInt32Slot(1, tparams, 0)
def AddTparams(builder, tparams):
    return GatherAddTparams(builder, tparams)
def GatherAddValidateIndices(builder, validateIndices): builder.PrependBoolSlot(2, validateIndices, 0)
def AddValidateIndices(builder, validateIndices):
    return GatherAddValidateIndices(builder, validateIndices)
def GatherAddAxis(builder, axis): builder.PrependInt32Slot(3, axis, 0)
def AddAxis(builder, axis):
    return GatherAddAxis(builder, axis)
def GatherEnd(builder): return builder.EndObject()
def End(builder):
    return GatherEnd(builder)