# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

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

    # Blob
    def DimsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # Blob
    def DimsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Blob
    def DimsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # Blob
    def DataFormat(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

    # Blob
    def DataType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 1

    # Blob
    def Uint8s(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.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Blob
    def Uint8sAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

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

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

    # Blob
    def Int8s(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.Int8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # Blob
    def Int8sAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int8Flags, o)
        return 0

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

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

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

    # Blob
    def Int32sAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o)
        return 0

    # Blob
    def Int32sLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Blob
    def Int32sIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        return o == 0

    # Blob
    def Int64s(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # Blob
    def Int64sAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # Blob
    def Int64sLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Blob
    def Int64sIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        return o == 0

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

    # Blob
    def Float32sAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # Blob
    def Float32sLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Blob
    def Float32sIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        return o == 0

    # Blob
    def Strings(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # Blob
    def StringsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Blob
    def StringsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        return o == 0

def BlobStart(builder): builder.StartObject(9)
def Start(builder):
    return BlobStart(builder)
def BlobAddDims(builder, dims): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(dims), 0)
def AddDims(builder, dims):
    return BlobAddDims(builder, dims)
def BlobStartDimsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartDimsVector(builder, numElems):
    return BlobStartDimsVector(builder, numElems)
def BlobAddDataFormat(builder, dataFormat): builder.PrependInt8Slot(1, dataFormat, 0)
def AddDataFormat(builder, dataFormat):
    return BlobAddDataFormat(builder, dataFormat)
def BlobAddDataType(builder, dataType): builder.PrependInt32Slot(2, dataType, 1)
def AddDataType(builder, dataType):
    return BlobAddDataType(builder, dataType)
def BlobAddUint8s(builder, uint8s): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(uint8s), 0)
def AddUint8s(builder, uint8s):
    return BlobAddUint8s(builder, uint8s)
def BlobStartUint8sVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartUint8sVector(builder, numElems):
    return BlobStartUint8sVector(builder, numElems)
def BlobAddInt8s(builder, int8s): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(int8s), 0)
def AddInt8s(builder, int8s):
    return BlobAddInt8s(builder, int8s)
def BlobStartInt8sVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartInt8sVector(builder, numElems):
    return BlobStartInt8sVector(builder, numElems)
def BlobAddInt32s(builder, int32s): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(int32s), 0)
def AddInt32s(builder, int32s):
    return BlobAddInt32s(builder, int32s)
def BlobStartInt32sVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartInt32sVector(builder, numElems):
    return BlobStartInt32sVector(builder, numElems)
def BlobAddInt64s(builder, int64s): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(int64s), 0)
def AddInt64s(builder, int64s):
    return BlobAddInt64s(builder, int64s)
def BlobStartInt64sVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartInt64sVector(builder, numElems):
    return BlobStartInt64sVector(builder, numElems)
def BlobAddFloat32s(builder, float32s): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(float32s), 0)
def AddFloat32s(builder, float32s):
    return BlobAddFloat32s(builder, float32s)
def BlobStartFloat32sVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartFloat32sVector(builder, numElems):
    return BlobStartFloat32sVector(builder, numElems)
def BlobAddStrings(builder, strings): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(strings), 0)
def AddStrings(builder, strings):
    return BlobAddStrings(builder, strings)
def BlobStartStringsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStringsVector(builder, numElems):
    return BlobStartStringsVector(builder, numElems)
def BlobEnd(builder): return builder.EndObject()
def End(builder):
    return BlobEnd(builder)