# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

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

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

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

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

    # Convolution2DCommon
    def StrideX(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 1

    # Convolution2DCommon
    def StrideY(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 1

    # Convolution2DCommon
    def DilateX(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 1

    # Convolution2DCommon
    def DilateY(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 1

    # Convolution2DCommon
    def PadMode(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

    # Convolution2DCommon
    def Group(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

    # Convolution2DCommon
    def OutputCount(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

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

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

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

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

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

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

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

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

    # Convolution2DCommon
    def OutPadsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # Convolution2DCommon
    def OutPadsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Convolution2DCommon
    def OutPadsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        return o == 0

    # Convolution2DCommon
    def HasOutputShape(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

    # Convolution2DCommon
    def PadV(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # Convolution2DCommon
    def PadVAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # Convolution2DCommon
    def PadVLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Convolution2DCommon
    def PadVIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        return o == 0

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

    # Convolution2DCommon
    def PadVQAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # Convolution2DCommon
    def PadVQLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Convolution2DCommon
    def PadVQIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        return o == 0

def Convolution2DCommonStart(builder): builder.StartObject(19)
def Start(builder):
    return Convolution2DCommonStart(builder)
def Convolution2DCommonAddPadX(builder, padX): builder.PrependInt32Slot(0, padX, 0)
def AddPadX(builder, padX):
    return Convolution2DCommonAddPadX(builder, padX)
def Convolution2DCommonAddPadY(builder, padY): builder.PrependInt32Slot(1, padY, 0)
def AddPadY(builder, padY):
    return Convolution2DCommonAddPadY(builder, padY)
def Convolution2DCommonAddKernelX(builder, kernelX): builder.PrependInt32Slot(2, kernelX, 1)
def AddKernelX(builder, kernelX):
    return Convolution2DCommonAddKernelX(builder, kernelX)
def Convolution2DCommonAddKernelY(builder, kernelY): builder.PrependInt32Slot(3, kernelY, 1)
def AddKernelY(builder, kernelY):
    return Convolution2DCommonAddKernelY(builder, kernelY)
def Convolution2DCommonAddStrideX(builder, strideX): builder.PrependInt32Slot(4, strideX, 1)
def AddStrideX(builder, strideX):
    return Convolution2DCommonAddStrideX(builder, strideX)
def Convolution2DCommonAddStrideY(builder, strideY): builder.PrependInt32Slot(5, strideY, 1)
def AddStrideY(builder, strideY):
    return Convolution2DCommonAddStrideY(builder, strideY)
def Convolution2DCommonAddDilateX(builder, dilateX): builder.PrependInt32Slot(6, dilateX, 1)
def AddDilateX(builder, dilateX):
    return Convolution2DCommonAddDilateX(builder, dilateX)
def Convolution2DCommonAddDilateY(builder, dilateY): builder.PrependInt32Slot(7, dilateY, 1)
def AddDilateY(builder, dilateY):
    return Convolution2DCommonAddDilateY(builder, dilateY)
def Convolution2DCommonAddPadMode(builder, padMode): builder.PrependInt8Slot(8, padMode, 0)
def AddPadMode(builder, padMode):
    return Convolution2DCommonAddPadMode(builder, padMode)
def Convolution2DCommonAddGroup(builder, group): builder.PrependInt32Slot(9, group, 1)
def AddGroup(builder, group):
    return Convolution2DCommonAddGroup(builder, group)
def Convolution2DCommonAddOutputCount(builder, outputCount): builder.PrependInt32Slot(10, outputCount, 0)
def AddOutputCount(builder, outputCount):
    return Convolution2DCommonAddOutputCount(builder, outputCount)
def Convolution2DCommonAddInputCount(builder, inputCount): builder.PrependInt32Slot(11, inputCount, 0)
def AddInputCount(builder, inputCount):
    return Convolution2DCommonAddInputCount(builder, inputCount)
def Convolution2DCommonAddRelu(builder, relu): builder.PrependBoolSlot(12, relu, 0)
def AddRelu(builder, relu):
    return Convolution2DCommonAddRelu(builder, relu)
def Convolution2DCommonAddRelu6(builder, relu6): builder.PrependBoolSlot(13, relu6, 0)
def AddRelu6(builder, relu6):
    return Convolution2DCommonAddRelu6(builder, relu6)
def Convolution2DCommonAddPads(builder, pads): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(pads), 0)
def AddPads(builder, pads):
    return Convolution2DCommonAddPads(builder, pads)
def Convolution2DCommonStartPadsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadsVector(builder, numElems):
    return Convolution2DCommonStartPadsVector(builder, numElems)
def Convolution2DCommonAddOutPads(builder, outPads): builder.PrependUOffsetTRelativeSlot(15, flatbuffers.number_types.UOffsetTFlags.py_type(outPads), 0)
def AddOutPads(builder, outPads):
    return Convolution2DCommonAddOutPads(builder, outPads)
def Convolution2DCommonStartOutPadsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartOutPadsVector(builder, numElems):
    return Convolution2DCommonStartOutPadsVector(builder, numElems)
def Convolution2DCommonAddHasOutputShape(builder, hasOutputShape): builder.PrependBoolSlot(16, hasOutputShape, 0)
def AddHasOutputShape(builder, hasOutputShape):
    return Convolution2DCommonAddHasOutputShape(builder, hasOutputShape)
def Convolution2DCommonAddPadV(builder, padV): builder.PrependUOffsetTRelativeSlot(17, flatbuffers.number_types.UOffsetTFlags.py_type(padV), 0)
def AddPadV(builder, padV):
    return Convolution2DCommonAddPadV(builder, padV)
def Convolution2DCommonStartPadVVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadVVector(builder, numElems):
    return Convolution2DCommonStartPadVVector(builder, numElems)
def Convolution2DCommonAddPadVQ(builder, padVQ): builder.PrependUOffsetTRelativeSlot(18, flatbuffers.number_types.UOffsetTFlags.py_type(padVQ), 0)
def AddPadVQ(builder, padVQ):
    return Convolution2DCommonAddPadVQ(builder, padVQ)
def Convolution2DCommonStartPadVQVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadVQVector(builder, numElems):
    return Convolution2DCommonStartPadVQVector(builder, numElems)
def Convolution2DCommonEnd(builder): return builder.EndObject()
def End(builder):
    return Convolution2DCommonEnd(builder)