# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # Convolution3DCommon
    def Dilates(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

    # Convolution3DCommon
    def DilatesAsNumpy(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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    # Convolution3DCommon
    def InputCount(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

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

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

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

def Convolution3DCommonStart(builder): builder.StartObject(9)
def Start(builder):
    return Convolution3DCommonStart(builder)
def Convolution3DCommonAddDilates(builder, dilates): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(dilates), 0)
def AddDilates(builder, dilates):
    return Convolution3DCommonAddDilates(builder, dilates)
def Convolution3DCommonStartDilatesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartDilatesVector(builder, numElems):
    return Convolution3DCommonStartDilatesVector(builder, numElems)
def Convolution3DCommonAddStrides(builder, strides): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(strides), 0)
def AddStrides(builder, strides):
    return Convolution3DCommonAddStrides(builder, strides)
def Convolution3DCommonStartStridesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStridesVector(builder, numElems):
    return Convolution3DCommonStartStridesVector(builder, numElems)
def Convolution3DCommonAddKernels(builder, kernels): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(kernels), 0)
def AddKernels(builder, kernels):
    return Convolution3DCommonAddKernels(builder, kernels)
def Convolution3DCommonStartKernelsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartKernelsVector(builder, numElems):
    return Convolution3DCommonStartKernelsVector(builder, numElems)
def Convolution3DCommonAddPads(builder, pads): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(pads), 0)
def AddPads(builder, pads):
    return Convolution3DCommonAddPads(builder, pads)
def Convolution3DCommonStartPadsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartPadsVector(builder, numElems):
    return Convolution3DCommonStartPadsVector(builder, numElems)
def Convolution3DCommonAddPadMode(builder, padMode): builder.PrependInt8Slot(4, padMode, 0)
def AddPadMode(builder, padMode):
    return Convolution3DCommonAddPadMode(builder, padMode)
def Convolution3DCommonAddInputCount(builder, inputCount): builder.PrependInt32Slot(5, inputCount, 0)
def AddInputCount(builder, inputCount):
    return Convolution3DCommonAddInputCount(builder, inputCount)
def Convolution3DCommonAddOutputCount(builder, outputCount): builder.PrependInt32Slot(6, outputCount, 0)
def AddOutputCount(builder, outputCount):
    return Convolution3DCommonAddOutputCount(builder, outputCount)
def Convolution3DCommonAddRelu(builder, relu): builder.PrependBoolSlot(7, relu, 0)
def AddRelu(builder, relu):
    return Convolution3DCommonAddRelu(builder, relu)
def Convolution3DCommonAddRelu6(builder, relu6): builder.PrependBoolSlot(8, relu6, 0)
def AddRelu6(builder, relu6):
    return Convolution3DCommonAddRelu6(builder, relu6)
def Convolution3DCommonEnd(builder): return builder.EndObject()
def End(builder):
    return Convolution3DCommonEnd(builder)