# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

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

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

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

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

def DequantizeStart(builder): builder.StartObject(4)
def Start(builder):
    return DequantizeStart(builder)
def DequantizeAddInputQuantizedParam(builder, inputQuantizedParam): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(inputQuantizedParam), 0)
def AddInputQuantizedParam(builder, inputQuantizedParam):
    return DequantizeAddInputQuantizedParam(builder, inputQuantizedParam)
def DequantizeAddMode(builder, mode): builder.PrependInt8Slot(1, mode, 0)
def AddMode(builder, mode):
    return DequantizeAddMode(builder, mode)
def DequantizeAddModelFormat(builder, modelFormat): builder.PrependInt8Slot(2, modelFormat, 0)
def AddModelFormat(builder, modelFormat):
    return DequantizeAddModelFormat(builder, modelFormat)
def DequantizeAddType(builder, type): builder.PrependInt32Slot(3, type, 0)
def AddType(builder, type):
    return DequantizeAddType(builder, type)
def DequantizeEnd(builder): return builder.EndObject()
def End(builder):
    return DequantizeEnd(builder)