# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # InterpSuperAcmeQuantizedParam
    def Mode(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

    # InterpSuperAcmeQuantizedParam
    def XPositions(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        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

    # InterpSuperAcmeQuantizedParam
    def XPositionsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # InterpSuperAcmeQuantizedParam
    def XPositionsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # InterpSuperAcmeQuantizedParam
    def XPositionsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # InterpSuperAcmeQuantizedParam
    def YPositions(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.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # InterpSuperAcmeQuantizedParam
    def YPositionsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

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

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

    # InterpSuperAcmeQuantizedParam
    def XFactors(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

    # InterpSuperAcmeQuantizedParam
    def XFactorsAsNumpy(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

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

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

    # InterpSuperAcmeQuantizedParam
    def YFactors(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        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

    # InterpSuperAcmeQuantizedParam
    def YFactorsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # InterpSuperAcmeQuantizedParam
    def YFactorsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # InterpSuperAcmeQuantizedParam
    def YFactorsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

    # InterpSuperAcmeQuantizedParam
    def UnifiedFactorShift(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # InterpSuperAcmeQuantizedParam
    def ClampMin(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return -128

    # InterpSuperAcmeQuantizedParam
    def ClampMax(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 127

def InterpSuperAcmeQuantizedParamStart(builder): builder.StartObject(8)
def Start(builder):
    return InterpSuperAcmeQuantizedParamStart(builder)
def InterpSuperAcmeQuantizedParamAddMode(builder, mode): builder.PrependInt32Slot(0, mode, 0)
def AddMode(builder, mode):
    return InterpSuperAcmeQuantizedParamAddMode(builder, mode)
def InterpSuperAcmeQuantizedParamAddXPositions(builder, xPositions): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(xPositions), 0)
def AddXPositions(builder, xPositions):
    return InterpSuperAcmeQuantizedParamAddXPositions(builder, xPositions)
def InterpSuperAcmeQuantizedParamStartXPositionsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartXPositionsVector(builder, numElems):
    return InterpSuperAcmeQuantizedParamStartXPositionsVector(builder, numElems)
def InterpSuperAcmeQuantizedParamAddYPositions(builder, yPositions): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(yPositions), 0)
def AddYPositions(builder, yPositions):
    return InterpSuperAcmeQuantizedParamAddYPositions(builder, yPositions)
def InterpSuperAcmeQuantizedParamStartYPositionsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartYPositionsVector(builder, numElems):
    return InterpSuperAcmeQuantizedParamStartYPositionsVector(builder, numElems)
def InterpSuperAcmeQuantizedParamAddXFactors(builder, xFactors): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(xFactors), 0)
def AddXFactors(builder, xFactors):
    return InterpSuperAcmeQuantizedParamAddXFactors(builder, xFactors)
def InterpSuperAcmeQuantizedParamStartXFactorsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartXFactorsVector(builder, numElems):
    return InterpSuperAcmeQuantizedParamStartXFactorsVector(builder, numElems)
def InterpSuperAcmeQuantizedParamAddYFactors(builder, yFactors): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(yFactors), 0)
def AddYFactors(builder, yFactors):
    return InterpSuperAcmeQuantizedParamAddYFactors(builder, yFactors)
def InterpSuperAcmeQuantizedParamStartYFactorsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartYFactorsVector(builder, numElems):
    return InterpSuperAcmeQuantizedParamStartYFactorsVector(builder, numElems)
def InterpSuperAcmeQuantizedParamAddUnifiedFactorShift(builder, unifiedFactorShift): builder.PrependInt32Slot(5, unifiedFactorShift, 0)
def AddUnifiedFactorShift(builder, unifiedFactorShift):
    return InterpSuperAcmeQuantizedParamAddUnifiedFactorShift(builder, unifiedFactorShift)
def InterpSuperAcmeQuantizedParamAddClampMin(builder, clampMin): builder.PrependInt8Slot(6, clampMin, -128)
def AddClampMin(builder, clampMin):
    return InterpSuperAcmeQuantizedParamAddClampMin(builder, clampMin)
def InterpSuperAcmeQuantizedParamAddClampMax(builder, clampMax): builder.PrependInt8Slot(7, clampMax, 127)
def AddClampMax(builder, clampMax):
    return InterpSuperAcmeQuantizedParamAddClampMax(builder, clampMax)
def InterpSuperAcmeQuantizedParamEnd(builder): return builder.EndObject()
def End(builder):
    return InterpSuperAcmeQuantizedParamEnd(builder)