# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

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

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

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

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

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

    # Conv2dSuperAcmeQuantizedParam
    def MRightShiftAsNumpy(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

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

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

    # Conv2dSuperAcmeQuantizedParam
    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

    # Conv2dSuperAcmeQuantizedParam
    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

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

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

    # Conv2dSuperAcmeQuantizedParam
    def Mmode(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

    # Conv2dSuperAcmeQuantizedParam
    def WeightType(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 6

def Conv2dSuperAcmeQuantizedParamStart(builder): builder.StartObject(5)
def Start(builder):
    return Conv2dSuperAcmeQuantizedParamStart(builder)
def Conv2dSuperAcmeQuantizedParamAddMquantizeMultiplier(builder, mquantizeMultiplier): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(mquantizeMultiplier), 0)
def AddMquantizeMultiplier(builder, mquantizeMultiplier):
    return Conv2dSuperAcmeQuantizedParamAddMquantizeMultiplier(builder, mquantizeMultiplier)
def Conv2dSuperAcmeQuantizedParamStartMquantizeMultiplierVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMquantizeMultiplierVector(builder, numElems):
    return Conv2dSuperAcmeQuantizedParamStartMquantizeMultiplierVector(builder, numElems)
def Conv2dSuperAcmeQuantizedParamAddMRightShift(builder, mRightShift): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(mRightShift), 0)
def AddMRightShift(builder, mRightShift):
    return Conv2dSuperAcmeQuantizedParamAddMRightShift(builder, mRightShift)
def Conv2dSuperAcmeQuantizedParamStartMRightShiftVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMRightShiftVector(builder, numElems):
    return Conv2dSuperAcmeQuantizedParamStartMRightShiftVector(builder, numElems)
def Conv2dSuperAcmeQuantizedParamAddMintbias(builder, mintbias): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(mintbias), 0)
def AddMintbias(builder, mintbias):
    return Conv2dSuperAcmeQuantizedParamAddMintbias(builder, mintbias)
def Conv2dSuperAcmeQuantizedParamStartMintbiasVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMintbiasVector(builder, numElems):
    return Conv2dSuperAcmeQuantizedParamStartMintbiasVector(builder, numElems)
def Conv2dSuperAcmeQuantizedParamAddMmode(builder, mmode): builder.PrependInt32Slot(3, mmode, 0)
def AddMmode(builder, mmode):
    return Conv2dSuperAcmeQuantizedParamAddMmode(builder, mmode)
def Conv2dSuperAcmeQuantizedParamAddWeightType(builder, weightType): builder.PrependInt32Slot(4, weightType, 6)
def AddWeightType(builder, weightType):
    return Conv2dSuperAcmeQuantizedParamAddWeightType(builder, weightType)
def Conv2dSuperAcmeQuantizedParamEnd(builder): return builder.EndObject()
def End(builder):
    return Conv2dSuperAcmeQuantizedParamEnd(builder)