mirror of https://github.com/alibaba/MNN.git
142 lines
4.5 KiB
Python
142 lines
4.5 KiB
Python
# automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
# namespace: CLCache
|
|
|
|
import flatbuffers
|
|
from flatbuffers.compat import import_numpy
|
|
np = import_numpy()
|
|
|
|
class Autotuning(object):
|
|
__slots__ = ['_tab']
|
|
|
|
@classmethod
|
|
def GetRootAs(cls, buf, offset=0):
|
|
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
x = Autotuning()
|
|
x.Init(buf, n + offset)
|
|
return x
|
|
|
|
@classmethod
|
|
def GetRootAsAutotuning(cls, buf, offset=0):
|
|
"""This method is deprecated. Please switch to GetRootAs."""
|
|
return cls.GetRootAs(buf, offset)
|
|
# Autotuning
|
|
def Init(self, buf, pos):
|
|
self._tab = flatbuffers.table.Table(buf, pos)
|
|
|
|
# Autotuning
|
|
def Key(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
if o != 0:
|
|
return self._tab.String(o + self._tab.Pos)
|
|
return None
|
|
|
|
# Autotuning
|
|
def GloablSize(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.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
|
return 0
|
|
|
|
# Autotuning
|
|
def GloablSizeAsNumpy(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
if o != 0:
|
|
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o)
|
|
return 0
|
|
|
|
# Autotuning
|
|
def GloablSizeLength(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
if o != 0:
|
|
return self._tab.VectorLen(o)
|
|
return 0
|
|
|
|
# Autotuning
|
|
def GloablSizeIsNone(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
return o == 0
|
|
|
|
# Autotuning
|
|
def LocalSize(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.Uint32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
|
return 0
|
|
|
|
# Autotuning
|
|
def LocalSizeAsNumpy(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
if o != 0:
|
|
return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint32Flags, o)
|
|
return 0
|
|
|
|
# Autotuning
|
|
def LocalSizeLength(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
if o != 0:
|
|
return self._tab.VectorLen(o)
|
|
return 0
|
|
|
|
# Autotuning
|
|
def LocalSizeIsNone(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
return o == 0
|
|
|
|
# Autotuning
|
|
def TimeCost(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
|
if o != 0:
|
|
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
|
|
return 0
|
|
|
|
def AutotuningStart(builder):
|
|
builder.StartObject(4)
|
|
|
|
def Start(builder):
|
|
AutotuningStart(builder)
|
|
|
|
def AutotuningAddKey(builder, key):
|
|
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
|
|
|
|
def AddKey(builder, key):
|
|
AutotuningAddKey(builder, key)
|
|
|
|
def AutotuningAddGloablSize(builder, gloablSize):
|
|
builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(gloablSize), 0)
|
|
|
|
def AddGloablSize(builder, gloablSize):
|
|
AutotuningAddGloablSize(builder, gloablSize)
|
|
|
|
def AutotuningStartGloablSizeVector(builder, numElems):
|
|
return builder.StartVector(4, numElems, 4)
|
|
|
|
def StartGloablSizeVector(builder, numElems):
|
|
return AutotuningStartGloablSizeVector(builder, numElems)
|
|
|
|
def AutotuningAddLocalSize(builder, localSize):
|
|
builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(localSize), 0)
|
|
|
|
def AddLocalSize(builder, localSize):
|
|
AutotuningAddLocalSize(builder, localSize)
|
|
|
|
def AutotuningStartLocalSizeVector(builder, numElems):
|
|
return builder.StartVector(4, numElems, 4)
|
|
|
|
def StartLocalSizeVector(builder, numElems):
|
|
return AutotuningStartLocalSizeVector(builder, numElems)
|
|
|
|
def AutotuningAddTimeCost(builder, timeCost):
|
|
builder.PrependUint32Slot(3, timeCost, 0)
|
|
|
|
def AddTimeCost(builder, timeCost):
|
|
AutotuningAddTimeCost(builder, timeCost)
|
|
|
|
def AutotuningEnd(builder):
|
|
return builder.EndObject()
|
|
|
|
def End(builder):
|
|
return AutotuningEnd(builder)
|