# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # LSTMBlockCell
    def CellClip(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 3.0

    # LSTMBlockCell
    def ForgetBias(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 1.0

    # LSTMBlockCell
    def UsePeephole(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

def LSTMBlockCellStart(builder): builder.StartObject(3)
def Start(builder):
    return LSTMBlockCellStart(builder)
def LSTMBlockCellAddCellClip(builder, cellClip): builder.PrependFloat32Slot(0, cellClip, 3.0)
def AddCellClip(builder, cellClip):
    return LSTMBlockCellAddCellClip(builder, cellClip)
def LSTMBlockCellAddForgetBias(builder, forgetBias): builder.PrependFloat32Slot(1, forgetBias, 1.0)
def AddForgetBias(builder, forgetBias):
    return LSTMBlockCellAddForgetBias(builder, forgetBias)
def LSTMBlockCellAddUsePeephole(builder, usePeephole): builder.PrependBoolSlot(2, usePeephole, 0)
def AddUsePeephole(builder, usePeephole):
    return LSTMBlockCellAddUsePeephole(builder, usePeephole)
def LSTMBlockCellEnd(builder): return builder.EndObject()
def End(builder):
    return LSTMBlockCellEnd(builder)