# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # QuantizedConcat
    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

    # QuantizedConcat
    def Axis(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

    # QuantizedConcat
    def InputScale(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # QuantizedConcat
    def InputScaleAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # QuantizedConcat
    def InputScaleLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # QuantizedConcat
    def InputScaleIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # QuantizedConcat
    def InputZeroPoint(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # QuantizedConcat
    def InputZeroPointAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # QuantizedConcat
    def InputZeroPointLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # QuantizedConcat
    def InputZeroPointIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

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

def QuantizedConcatStart(builder): builder.StartObject(5)
def Start(builder):
    return QuantizedConcatStart(builder)
def QuantizedConcatAddActivationType(builder, activationType): builder.PrependInt8Slot(0, activationType, 0)
def AddActivationType(builder, activationType):
    return QuantizedConcatAddActivationType(builder, activationType)
def QuantizedConcatAddAxis(builder, axis): builder.PrependInt32Slot(1, axis, 0)
def AddAxis(builder, axis):
    return QuantizedConcatAddAxis(builder, axis)
def QuantizedConcatAddInputScale(builder, inputScale): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(inputScale), 0)
def AddInputScale(builder, inputScale):
    return QuantizedConcatAddInputScale(builder, inputScale)
def QuantizedConcatStartInputScaleVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartInputScaleVector(builder, numElems):
    return QuantizedConcatStartInputScaleVector(builder, numElems)
def QuantizedConcatAddInputZeroPoint(builder, inputZeroPoint): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(inputZeroPoint), 0)
def AddInputZeroPoint(builder, inputZeroPoint):
    return QuantizedConcatAddInputZeroPoint(builder, inputZeroPoint)
def QuantizedConcatStartInputZeroPointVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartInputZeroPointVector(builder, numElems):
    return QuantizedConcatStartInputZeroPointVector(builder, numElems)
def QuantizedConcatAddOutputQuantizedParam(builder, outputQuantizedParam): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(outputQuantizedParam), 0)
def AddOutputQuantizedParam(builder, outputQuantizedParam):
    return QuantizedConcatAddOutputQuantizedParam(builder, outputQuantizedParam)
def QuantizedConcatEnd(builder): return builder.EndObject()
def End(builder):
    return QuantizedConcatEnd(builder)