# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # LRN
    def RegionType(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

    # LRN
    def LocalSize(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

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

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

def LRNStart(builder): builder.StartObject(4)
def Start(builder):
    return LRNStart(builder)
def LRNAddRegionType(builder, regionType): builder.PrependInt32Slot(0, regionType, 0)
def AddRegionType(builder, regionType):
    return LRNAddRegionType(builder, regionType)
def LRNAddLocalSize(builder, localSize): builder.PrependInt32Slot(1, localSize, 0)
def AddLocalSize(builder, localSize):
    return LRNAddLocalSize(builder, localSize)
def LRNAddAlpha(builder, alpha): builder.PrependFloat32Slot(2, alpha, 0.0)
def AddAlpha(builder, alpha):
    return LRNAddAlpha(builder, alpha)
def LRNAddBeta(builder, beta): builder.PrependFloat32Slot(3, beta, 0.0)
def AddBeta(builder, beta):
    return LRNAddBeta(builder, beta)
def LRNEnd(builder): return builder.EndObject()
def End(builder):
    return LRNEnd(builder)