# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # QuantizedAdd
    def ActivationType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # QuantizedAdd
    def Input1QuantizedParam(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = QuantizedParam()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # QuantizedAdd
    def Input2QuantizedParam(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = QuantizedParam()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def QuantizedAddStart(builder): builder.StartObject(4)
def Start(builder):
    return QuantizedAddStart(builder)
def QuantizedAddAddActivationType(builder, activationType): builder.PrependInt8Slot(0, activationType, 0)
def AddActivationType(builder, activationType):
    return QuantizedAddAddActivationType(builder, activationType)
def QuantizedAddAddInput1QuantizedParam(builder, input1QuantizedParam): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(input1QuantizedParam), 0)
def AddInput1QuantizedParam(builder, input1QuantizedParam):
    return QuantizedAddAddInput1QuantizedParam(builder, input1QuantizedParam)
def QuantizedAddAddInput2QuantizedParam(builder, input2QuantizedParam): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(input2QuantizedParam), 0)
def AddInput2QuantizedParam(builder, input2QuantizedParam):
    return QuantizedAddAddInput2QuantizedParam(builder, input2QuantizedParam)
def QuantizedAddAddOutputQuantizedParam(builder, outputQuantizedParam): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(outputQuantizedParam), 0)
def AddOutputQuantizedParam(builder, outputQuantizedParam):
    return QuantizedAddAddOutputQuantizedParam(builder, outputQuantizedParam)
def QuantizedAddEnd(builder): return builder.EndObject()
def End(builder):
    return QuantizedAddEnd(builder)