# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # Pool3D
    def Strides(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

    # Pool3D
    def StridesAsNumpy(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

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

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

    # Pool3D
    def Kernels(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

    # Pool3D
    def KernelsAsNumpy(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

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

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

    # Pool3D
    def Pads(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

    # Pool3D
    def PadsAsNumpy(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

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

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

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

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

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

    # Pool3D
    def OutputOffset(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

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

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

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

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

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

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

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

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

    # Pool3D
    def InputZeroPoint(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

def Pool3DStart(builder): builder.StartObject(16)
def Start(builder):
    return Pool3DStart(builder)
def Pool3DAddStrides(builder, strides): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(strides), 0)
def AddStrides(builder, strides):
    return Pool3DAddStrides(builder, strides)
def Pool3DStartStridesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStridesVector(builder, numElems):
    return Pool3DStartStridesVector(builder, numElems)
def Pool3DAddKernels(builder, kernels): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(kernels), 0)
def AddKernels(builder, kernels):
    return Pool3DAddKernels(builder, kernels)
def Pool3DStartKernelsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartKernelsVector(builder, numElems):
    return Pool3DStartKernelsVector(builder, numElems)
def Pool3DAddPads(builder, pads): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(pads), 0)
def AddPads(builder, pads):
    return Pool3DAddPads(builder, pads)
def Pool3DStartPadsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadsVector(builder, numElems):
    return Pool3DStartPadsVector(builder, numElems)
def Pool3DAddType(builder, type): builder.PrependInt8Slot(3, type, 0)
def AddType(builder, type):
    return Pool3DAddType(builder, type)
def Pool3DAddPadType(builder, padType): builder.PrependInt8Slot(4, padType, 0)
def AddPadType(builder, padType):
    return Pool3DAddPadType(builder, padType)
def Pool3DAddIsGlobal(builder, isGlobal): builder.PrependBoolSlot(5, isGlobal, 0)
def AddIsGlobal(builder, isGlobal):
    return Pool3DAddIsGlobal(builder, isGlobal)
def Pool3DAddOutputOffset(builder, outputOffset): builder.PrependInt32Slot(6, outputOffset, 0)
def AddOutputOffset(builder, outputOffset):
    return Pool3DAddOutputOffset(builder, outputOffset)
def Pool3DAddOutputMultiplierWithK(builder, outputMultiplierWithK): builder.PrependInt32Slot(7, outputMultiplierWithK, 0)
def AddOutputMultiplierWithK(builder, outputMultiplierWithK):
    return Pool3DAddOutputMultiplierWithK(builder, outputMultiplierWithK)
def Pool3DAddOutputShiftWithK(builder, outputShiftWithK): builder.PrependInt32Slot(8, outputShiftWithK, 0)
def AddOutputShiftWithK(builder, outputShiftWithK):
    return Pool3DAddOutputShiftWithK(builder, outputShiftWithK)
def Pool3DAddIfUseInt8(builder, ifUseInt8): builder.PrependBoolSlot(9, ifUseInt8, 0)
def AddIfUseInt8(builder, ifUseInt8):
    return Pool3DAddIfUseInt8(builder, ifUseInt8)
def Pool3DAddMode(builder, mode): builder.PrependInt32Slot(10, mode, 0)
def AddMode(builder, mode):
    return Pool3DAddMode(builder, mode)
def Pool3DAddOriginputscale(builder, originputscale): builder.PrependFloat32Slot(11, originputscale, 0.0)
def AddOriginputscale(builder, originputscale):
    return Pool3DAddOriginputscale(builder, originputscale)
def Pool3DAddOrigoutputscale(builder, origoutputscale): builder.PrependFloat32Slot(12, origoutputscale, 0.0)
def AddOrigoutputscale(builder, origoutputscale):
    return Pool3DAddOrigoutputscale(builder, origoutputscale)
def Pool3DAddClampMin(builder, clampMin): builder.PrependInt8Slot(13, clampMin, -128)
def AddClampMin(builder, clampMin):
    return Pool3DAddClampMin(builder, clampMin)
def Pool3DAddClampMax(builder, clampMax): builder.PrependInt8Slot(14, clampMax, 127)
def AddClampMax(builder, clampMax):
    return Pool3DAddClampMax(builder, clampMax)
def Pool3DAddInputZeroPoint(builder, inputZeroPoint): builder.PrependInt32Slot(15, inputZeroPoint, 0)
def AddInputZeroPoint(builder, inputZeroPoint):
    return Pool3DAddInputZeroPoint(builder, inputZeroPoint)
def Pool3DEnd(builder): return builder.EndObject()
def End(builder):
    return Pool3DEnd(builder)