# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

import flatbuffers

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

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

    # 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)
            from .QuantizedParam import QuantizedParam
            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)
            from .QuantizedParam import QuantizedParam
            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)
            from .QuantizedParam import QuantizedParam
            obj = QuantizedParam()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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