# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # ArgMax
    def OutMaxVal(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

    # ArgMax
    def TopK(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

    # ArgMax
    def Axis(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 0

    # ArgMax
    def SoftmaxThreshold(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

    # ArgMax
    def Argmax(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ArgMaxSuperAcmeQuantizedParam()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def ArgMaxStart(builder): builder.StartObject(5)
def Start(builder):
    return ArgMaxStart(builder)
def ArgMaxAddOutMaxVal(builder, outMaxVal): builder.PrependInt32Slot(0, outMaxVal, 0)
def AddOutMaxVal(builder, outMaxVal):
    return ArgMaxAddOutMaxVal(builder, outMaxVal)
def ArgMaxAddTopK(builder, topK): builder.PrependInt32Slot(1, topK, 0)
def AddTopK(builder, topK):
    return ArgMaxAddTopK(builder, topK)
def ArgMaxAddAxis(builder, axis): builder.PrependInt32Slot(2, axis, 0)
def AddAxis(builder, axis):
    return ArgMaxAddAxis(builder, axis)
def ArgMaxAddSoftmaxThreshold(builder, softmaxThreshold): builder.PrependInt32Slot(3, softmaxThreshold, 0)
def AddSoftmaxThreshold(builder, softmaxThreshold):
    return ArgMaxAddSoftmaxThreshold(builder, softmaxThreshold)
def ArgMaxAddArgmax(builder, argmax): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(argmax), 0)
def AddArgmax(builder, argmax):
    return ArgMaxAddArgmax(builder, argmax)
def ArgMaxEnd(builder): return builder.EndObject()
def End(builder):
    return ArgMaxEnd(builder)