# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # ScaleSuperAcmeQuantizedParam
    def MRightShift(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

    # ScaleSuperAcmeQuantizedParam
    def MquantizeMultiplier(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.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # ScaleSuperAcmeQuantizedParam
    def MquantizeMultiplierAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

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

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

    # ScaleSuperAcmeQuantizedParam
    def Mintbias(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.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # ScaleSuperAcmeQuantizedParam
    def MintbiasAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

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

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

    # ScaleSuperAcmeQuantizedParam
    def OutputActivationMin(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

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

def ScaleSuperAcmeQuantizedParamStart(builder): builder.StartObject(5)
def Start(builder):
    return ScaleSuperAcmeQuantizedParamStart(builder)
def ScaleSuperAcmeQuantizedParamAddMRightShift(builder, mRightShift): builder.PrependInt32Slot(0, mRightShift, 0)
def AddMRightShift(builder, mRightShift):
    return ScaleSuperAcmeQuantizedParamAddMRightShift(builder, mRightShift)
def ScaleSuperAcmeQuantizedParamAddMquantizeMultiplier(builder, mquantizeMultiplier): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(mquantizeMultiplier), 0)
def AddMquantizeMultiplier(builder, mquantizeMultiplier):
    return ScaleSuperAcmeQuantizedParamAddMquantizeMultiplier(builder, mquantizeMultiplier)
def ScaleSuperAcmeQuantizedParamStartMquantizeMultiplierVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMquantizeMultiplierVector(builder, numElems):
    return ScaleSuperAcmeQuantizedParamStartMquantizeMultiplierVector(builder, numElems)
def ScaleSuperAcmeQuantizedParamAddMintbias(builder, mintbias): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(mintbias), 0)
def AddMintbias(builder, mintbias):
    return ScaleSuperAcmeQuantizedParamAddMintbias(builder, mintbias)
def ScaleSuperAcmeQuantizedParamStartMintbiasVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMintbiasVector(builder, numElems):
    return ScaleSuperAcmeQuantizedParamStartMintbiasVector(builder, numElems)
def ScaleSuperAcmeQuantizedParamAddOutputActivationMin(builder, outputActivationMin): builder.PrependInt32Slot(3, outputActivationMin, 0)
def AddOutputActivationMin(builder, outputActivationMin):
    return ScaleSuperAcmeQuantizedParamAddOutputActivationMin(builder, outputActivationMin)
def ScaleSuperAcmeQuantizedParamAddOutputActivationMax(builder, outputActivationMax): builder.PrependInt32Slot(4, outputActivationMax, 0)
def AddOutputActivationMax(builder, outputActivationMax):
    return ScaleSuperAcmeQuantizedParamAddOutputActivationMax(builder, outputActivationMax)
def ScaleSuperAcmeQuantizedParamEnd(builder): return builder.EndObject()
def End(builder):
    return ScaleSuperAcmeQuantizedParamEnd(builder)