# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # Pool
    def PadX(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

    # Pool
    def PadY(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

    # Pool
    def IsGlobal(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

    # Pool
    def KernelX(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

    # Pool
    def KernelY(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

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

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

    # Pool
    def Type(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # Pool
    def PadType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # Pool
    def DataType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 1

    # Pool
    def CeilModel(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return True

    # Pool
    def Pads(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        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

    # Pool
    def PadsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # Pool
    def PadsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Pool
    def PadsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        return o == 0

    # Pool
    def CountType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

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

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

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

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

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

    # Pool
    def Originputscale(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # Pool
    def Origoutputscale(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # Pool
    def ClampMin(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return -128

    # Pool
    def ClampMax(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 127

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

    # Pool
    def MquantizeMultiplier(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(50))
        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

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

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

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

def PoolStart(builder): builder.StartObject(24)
def Start(builder):
    return PoolStart(builder)
def PoolAddPadX(builder, padX): builder.PrependInt32Slot(0, padX, 0)
def AddPadX(builder, padX):
    return PoolAddPadX(builder, padX)
def PoolAddPadY(builder, padY): builder.PrependInt32Slot(1, padY, 0)
def AddPadY(builder, padY):
    return PoolAddPadY(builder, padY)
def PoolAddIsGlobal(builder, isGlobal): builder.PrependBoolSlot(2, isGlobal, 0)
def AddIsGlobal(builder, isGlobal):
    return PoolAddIsGlobal(builder, isGlobal)
def PoolAddKernelX(builder, kernelX): builder.PrependInt32Slot(3, kernelX, 0)
def AddKernelX(builder, kernelX):
    return PoolAddKernelX(builder, kernelX)
def PoolAddKernelY(builder, kernelY): builder.PrependInt32Slot(4, kernelY, 0)
def AddKernelY(builder, kernelY):
    return PoolAddKernelY(builder, kernelY)
def PoolAddStrideX(builder, strideX): builder.PrependInt32Slot(5, strideX, 0)
def AddStrideX(builder, strideX):
    return PoolAddStrideX(builder, strideX)
def PoolAddStrideY(builder, strideY): builder.PrependInt32Slot(6, strideY, 0)
def AddStrideY(builder, strideY):
    return PoolAddStrideY(builder, strideY)
def PoolAddType(builder, type): builder.PrependInt8Slot(7, type, 0)
def AddType(builder, type):
    return PoolAddType(builder, type)
def PoolAddPadType(builder, padType): builder.PrependInt8Slot(8, padType, 0)
def AddPadType(builder, padType):
    return PoolAddPadType(builder, padType)
def PoolAddDataType(builder, dataType): builder.PrependInt32Slot(9, dataType, 1)
def AddDataType(builder, dataType):
    return PoolAddDataType(builder, dataType)
def PoolAddCeilModel(builder, ceilModel): builder.PrependBoolSlot(10, ceilModel, 1)
def AddCeilModel(builder, ceilModel):
    return PoolAddCeilModel(builder, ceilModel)
def PoolAddPads(builder, pads): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(pads), 0)
def AddPads(builder, pads):
    return PoolAddPads(builder, pads)
def PoolStartPadsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadsVector(builder, numElems):
    return PoolStartPadsVector(builder, numElems)
def PoolAddCountType(builder, countType): builder.PrependInt8Slot(12, countType, 0)
def AddCountType(builder, countType):
    return PoolAddCountType(builder, countType)
def PoolAddOutputOffset(builder, outputOffset): builder.PrependInt32Slot(13, outputOffset, 0)
def AddOutputOffset(builder, outputOffset):
    return PoolAddOutputOffset(builder, outputOffset)
def PoolAddOutputMultiplierWithK(builder, outputMultiplierWithK): builder.PrependInt32Slot(14, outputMultiplierWithK, 0)
def AddOutputMultiplierWithK(builder, outputMultiplierWithK):
    return PoolAddOutputMultiplierWithK(builder, outputMultiplierWithK)
def PoolAddOutputShiftWithK(builder, outputShiftWithK): builder.PrependInt32Slot(15, outputShiftWithK, 0)
def AddOutputShiftWithK(builder, outputShiftWithK):
    return PoolAddOutputShiftWithK(builder, outputShiftWithK)
def PoolAddIfUseInt8(builder, ifUseInt8): builder.PrependBoolSlot(16, ifUseInt8, 0)
def AddIfUseInt8(builder, ifUseInt8):
    return PoolAddIfUseInt8(builder, ifUseInt8)
def PoolAddMode(builder, mode): builder.PrependInt32Slot(17, mode, 0)
def AddMode(builder, mode):
    return PoolAddMode(builder, mode)
def PoolAddOriginputscale(builder, originputscale): builder.PrependFloat32Slot(18, originputscale, 0.0)
def AddOriginputscale(builder, originputscale):
    return PoolAddOriginputscale(builder, originputscale)
def PoolAddOrigoutputscale(builder, origoutputscale): builder.PrependFloat32Slot(19, origoutputscale, 0.0)
def AddOrigoutputscale(builder, origoutputscale):
    return PoolAddOrigoutputscale(builder, origoutputscale)
def PoolAddClampMin(builder, clampMin): builder.PrependInt8Slot(20, clampMin, -128)
def AddClampMin(builder, clampMin):
    return PoolAddClampMin(builder, clampMin)
def PoolAddClampMax(builder, clampMax): builder.PrependInt8Slot(21, clampMax, 127)
def AddClampMax(builder, clampMax):
    return PoolAddClampMax(builder, clampMax)
def PoolAddInputZeroPoint(builder, inputZeroPoint): builder.PrependInt32Slot(22, inputZeroPoint, 0)
def AddInputZeroPoint(builder, inputZeroPoint):
    return PoolAddInputZeroPoint(builder, inputZeroPoint)
def PoolAddMquantizeMultiplier(builder, mquantizeMultiplier): builder.PrependUOffsetTRelativeSlot(23, flatbuffers.number_types.UOffsetTFlags.py_type(mquantizeMultiplier), 0)
def AddMquantizeMultiplier(builder, mquantizeMultiplier):
    return PoolAddMquantizeMultiplier(builder, mquantizeMultiplier)
def PoolStartMquantizeMultiplierVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMquantizeMultiplierVector(builder, numElems):
    return PoolStartMquantizeMultiplierVector(builder, numElems)
def PoolEnd(builder): return builder.EndObject()
def End(builder):
    return PoolEnd(builder)