# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

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

    # LSTM
    def WeightSize(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

    # LSTM
    def ClippingThreshold(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

    # LSTM
    def WeightI(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # LSTM
    def WeightH(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # LSTM
    def Bias(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # LSTM
    def WeightIq(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # LSTM
    def WeightIa(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def LSTMStart(builder): builder.StartObject(9)
def Start(builder):
    return LSTMStart(builder)
def LSTMAddOutputCount(builder, outputCount): builder.PrependInt32Slot(0, outputCount, 0)
def AddOutputCount(builder, outputCount):
    return LSTMAddOutputCount(builder, outputCount)
def LSTMAddWeightSize(builder, weightSize): builder.PrependInt32Slot(1, weightSize, 0)
def AddWeightSize(builder, weightSize):
    return LSTMAddWeightSize(builder, weightSize)
def LSTMAddClippingThreshold(builder, clippingThreshold): builder.PrependFloat32Slot(2, clippingThreshold, 0.0)
def AddClippingThreshold(builder, clippingThreshold):
    return LSTMAddClippingThreshold(builder, clippingThreshold)
def LSTMAddWeightI(builder, weightI): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(weightI), 0)
def AddWeightI(builder, weightI):
    return LSTMAddWeightI(builder, weightI)
def LSTMAddWeightH(builder, weightH): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(weightH), 0)
def AddWeightH(builder, weightH):
    return LSTMAddWeightH(builder, weightH)
def LSTMAddBias(builder, bias): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(bias), 0)
def AddBias(builder, bias):
    return LSTMAddBias(builder, bias)
def LSTMAddWeightIq(builder, weightIq): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(weightIq), 0)
def AddWeightIq(builder, weightIq):
    return LSTMAddWeightIq(builder, weightIq)
def LSTMAddWeightIa(builder, weightIa): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(weightIa), 0)
def AddWeightIa(builder, weightIa):
    return LSTMAddWeightIa(builder, weightIa)
def LSTMAddQuantScale(builder, quantScale): builder.PrependFloat32Slot(8, quantScale, 0.0)
def AddQuantScale(builder, quantScale):
    return LSTMAddQuantScale(builder, quantScale)
def LSTMEnd(builder): return builder.EndObject()
def End(builder):
    return LSTMEnd(builder)