From aba71edb4feb0fa6adf03832c6179aa01ae676f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Wed, 5 Sep 2018 12:15:55 +0900 Subject: [PATCH] [Model Parser] Update tflite file API (#2580) Update tflite file API: schema in tensorflow r1.10 Signed-off-by: Hyeongseok Oh --- tools/tflitefile_tool/tflite/ArgMinOptions.py | 39 ++++++++++++ tools/tflitefile_tool/tflite/BuiltinOperator.py | 12 ++++ tools/tflitefile_tool/tflite/BuiltinOptions.py | 10 ++- tools/tflitefile_tool/tflite/EqualOptions.py | 28 +++++++++ tools/tflitefile_tool/tflite/ExpandDimsOptions.py | 28 +++++++++ tools/tflitefile_tool/tflite/FakeQuantOptions.py | 72 ++++++++++++++++++++++ .../tflite/FullyConnectedOptions.py | 13 +++- .../tflite/FullyConnectedOptionsWeightsFormat.py | 8 +++ tools/tflitefile_tool/tflite/LSTMKernelType.py | 8 +++ tools/tflitefile_tool/tflite/LSTMOptions.py | 13 +++- tools/tflitefile_tool/tflite/Model.py | 2 +- tools/tflitefile_tool/tflite/NotEqualOptions.py | 28 +++++++++ tools/tflitefile_tool/tflite/Operator.py | 35 ++++++++++- tools/tflitefile_tool/tflite/OperatorCode.py | 2 +- tools/tflitefile_tool/tflite/PowOptions.py | 28 +++++++++ tools/tflitefile_tool/tflite/ReducerOptions.py | 39 ++++++++++++ tools/tflitefile_tool/tflite/ShapeOptions.py | 39 ++++++++++++ tools/tflitefile_tool/tflite/SubGraph.py | 2 +- tools/tflitefile_tool/tflite/Tensor.py | 15 ++++- tools/tflitefile_tool/tflite/TensorType.py | 2 + tools/tflitefile_tool/tflite/TileOptions.py | 28 +++++++++ 21 files changed, 442 insertions(+), 9 deletions(-) create mode 100644 tools/tflitefile_tool/tflite/ArgMinOptions.py create mode 100644 tools/tflitefile_tool/tflite/EqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/ExpandDimsOptions.py create mode 100644 tools/tflitefile_tool/tflite/FakeQuantOptions.py create mode 100644 tools/tflitefile_tool/tflite/FullyConnectedOptionsWeightsFormat.py create mode 100644 tools/tflitefile_tool/tflite/LSTMKernelType.py create mode 100644 tools/tflitefile_tool/tflite/NotEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/PowOptions.py create mode 100644 tools/tflitefile_tool/tflite/ReducerOptions.py create mode 100644 tools/tflitefile_tool/tflite/ShapeOptions.py create mode 100644 tools/tflitefile_tool/tflite/TileOptions.py diff --git a/tools/tflitefile_tool/tflite/ArgMinOptions.py b/tools/tflitefile_tool/tflite/ArgMinOptions.py new file mode 100644 index 0000000..6a2dcdf --- /dev/null +++ b/tools/tflitefile_tool/tflite/ArgMinOptions.py @@ -0,0 +1,39 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class ArgMinOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArgMinOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ArgMinOptions() + x.Init(buf, n + offset) + return x + + # ArgMinOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ArgMinOptions + def OutputType(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 + + +def ArgMinOptionsStart(builder): + builder.StartObject(1) + + +def ArgMinOptionsAddOutputType(builder, outputType): + builder.PrependInt8Slot(0, outputType, 0) + + +def ArgMinOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/BuiltinOperator.py b/tools/tflitefile_tool/tflite/BuiltinOperator.py index a629001..2beda09 100644 --- a/tools/tflitefile_tool/tflite/BuiltinOperator.py +++ b/tools/tflitefile_tool/tflite/BuiltinOperator.py @@ -72,3 +72,15 @@ class BuiltinOperator(object): SIN = 66 TRANSPOSE_CONV = 67 SPARSE_TO_DENSE = 68 + TILE = 69 + EXPAND_DIMS = 70 + EQUAL = 71 + NOT_EQUAL = 72 + LOG = 73 + SUM = 74 + SQRT = 75 + RSQRT = 76 + SHAPE = 77 + POW = 78 + ARG_MIN = 79 + FAKE_QUANT = 80 diff --git a/tools/tflitefile_tool/tflite/BuiltinOptions.py b/tools/tflitefile_tool/tflite/BuiltinOptions.py index b979d89..5d30408 100644 --- a/tools/tflitefile_tool/tflite/BuiltinOptions.py +++ b/tools/tflitefile_tool/tflite/BuiltinOptions.py @@ -31,7 +31,7 @@ class BuiltinOptions(object): BatchToSpaceNDOptions = 24 SpaceToBatchNDOptions = 25 TransposeOptions = 26 - MeanOptions = 27 + ReducerOptions = 27 SubOptions = 28 DivOptions = 29 SqueezeOptions = 30 @@ -55,3 +55,11 @@ class BuiltinOptions(object): SliceOptions = 48 TransposeConvOptions = 49 SparseToDenseOptions = 50 + TileOptions = 51 + ExpandDimsOptions = 52 + EqualOptions = 53 + NotEqualOptions = 54 + ShapeOptions = 55 + PowOptions = 56 + ArgMinOptions = 57 + FakeQuantOptions = 58 diff --git a/tools/tflitefile_tool/tflite/EqualOptions.py b/tools/tflitefile_tool/tflite/EqualOptions.py new file mode 100644 index 0000000..968712f --- /dev/null +++ b/tools/tflitefile_tool/tflite/EqualOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class EqualOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsEqualOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = EqualOptions() + x.Init(buf, n + offset) + return x + + # EqualOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def EqualOptionsStart(builder): + builder.StartObject(0) + + +def EqualOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/ExpandDimsOptions.py b/tools/tflitefile_tool/tflite/ExpandDimsOptions.py new file mode 100644 index 0000000..2dd8d50 --- /dev/null +++ b/tools/tflitefile_tool/tflite/ExpandDimsOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class ExpandDimsOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsExpandDimsOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ExpandDimsOptions() + x.Init(buf, n + offset) + return x + + # ExpandDimsOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def ExpandDimsOptionsStart(builder): + builder.StartObject(0) + + +def ExpandDimsOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/FakeQuantOptions.py b/tools/tflitefile_tool/tflite/FakeQuantOptions.py new file mode 100644 index 0000000..fc8023e --- /dev/null +++ b/tools/tflitefile_tool/tflite/FakeQuantOptions.py @@ -0,0 +1,72 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class FakeQuantOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsFakeQuantOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = FakeQuantOptions() + x.Init(buf, n + offset) + return x + + # FakeQuantOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # FakeQuantOptions + def Min(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) + return 0.0 + + # FakeQuantOptions + def Max(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) + return 0.0 + + # FakeQuantOptions + def NumBits(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 0 + + # FakeQuantOptions + def NarrowRange(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos) + return 0 + + +def FakeQuantOptionsStart(builder): + builder.StartObject(4) + + +def FakeQuantOptionsAddMin(builder, min): + builder.PrependFloat32Slot(0, min, 0.0) + + +def FakeQuantOptionsAddMax(builder, max): + builder.PrependFloat32Slot(1, max, 0.0) + + +def FakeQuantOptionsAddNumBits(builder, numBits): + builder.PrependInt32Slot(2, numBits, 0) + + +def FakeQuantOptionsAddNarrowRange(builder, narrowRange): + builder.PrependBoolSlot(3, narrowRange, 0) + + +def FakeQuantOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/FullyConnectedOptions.py b/tools/tflitefile_tool/tflite/FullyConnectedOptions.py index 366c5e8..59c2a36 100644 --- a/tools/tflitefile_tool/tflite/FullyConnectedOptions.py +++ b/tools/tflitefile_tool/tflite/FullyConnectedOptions.py @@ -26,14 +26,25 @@ class FullyConnectedOptions(object): return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) return 0 + # FullyConnectedOptions + def WeightsFormat(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 + def FullyConnectedOptionsStart(builder): - builder.StartObject(1) + builder.StartObject(2) def FullyConnectedOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0) +def FullyConnectedOptionsAddWeightsFormat(builder, weightsFormat): + builder.PrependInt8Slot(1, weightsFormat, 0) + + def FullyConnectedOptionsEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/FullyConnectedOptionsWeightsFormat.py b/tools/tflitefile_tool/tflite/FullyConnectedOptionsWeightsFormat.py new file mode 100644 index 0000000..143fc51 --- /dev/null +++ b/tools/tflitefile_tool/tflite/FullyConnectedOptionsWeightsFormat.py @@ -0,0 +1,8 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + + +class FullyConnectedOptionsWeightsFormat(object): + DEFAULT = 0 + SHUFFLED4x16INT8 = 1 diff --git a/tools/tflitefile_tool/tflite/LSTMKernelType.py b/tools/tflitefile_tool/tflite/LSTMKernelType.py new file mode 100644 index 0000000..f0e96f3 --- /dev/null +++ b/tools/tflitefile_tool/tflite/LSTMKernelType.py @@ -0,0 +1,8 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + + +class LSTMKernelType(object): + FULL = 0 + BASIC = 1 diff --git a/tools/tflitefile_tool/tflite/LSTMOptions.py b/tools/tflitefile_tool/tflite/LSTMOptions.py index f9a44f5..97c5bd8 100644 --- a/tools/tflitefile_tool/tflite/LSTMOptions.py +++ b/tools/tflitefile_tool/tflite/LSTMOptions.py @@ -40,9 +40,16 @@ class LSTMOptions(object): return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos) return 0.0 + # LSTMOptions + def KernelType(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) + return 0 + def LSTMOptionsStart(builder): - builder.StartObject(3) + builder.StartObject(4) def LSTMOptionsAddFusedActivationFunction(builder, fusedActivationFunction): @@ -57,5 +64,9 @@ def LSTMOptionsAddProjClip(builder, projClip): builder.PrependFloat32Slot(2, projClip, 0.0) +def LSTMOptionsAddKernelType(builder, kernelType): + builder.PrependInt8Slot(3, kernelType, 0) + + def LSTMOptionsEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/Model.py b/tools/tflitefile_tool/tflite/Model.py index af53629..4d1e01f 100644 --- a/tools/tflitefile_tool/tflite/Model.py +++ b/tools/tflitefile_tool/tflite/Model.py @@ -71,7 +71,7 @@ class Model(object): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.String(o + self._tab.Pos) - return bytes() + return "" # Model def Buffers(self, j): diff --git a/tools/tflitefile_tool/tflite/NotEqualOptions.py b/tools/tflitefile_tool/tflite/NotEqualOptions.py new file mode 100644 index 0000000..25419ce --- /dev/null +++ b/tools/tflitefile_tool/tflite/NotEqualOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class NotEqualOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNotEqualOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NotEqualOptions() + x.Init(buf, n + offset) + return x + + # NotEqualOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def NotEqualOptionsStart(builder): + builder.StartObject(0) + + +def NotEqualOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/Operator.py b/tools/tflitefile_tool/tflite/Operator.py index 889d484..67cc8f0 100644 --- a/tools/tflitefile_tool/tflite/Operator.py +++ b/tools/tflitefile_tool/tflite/Operator.py @@ -122,9 +122,33 @@ class Operator(object): return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) return 0 + # Operator + def MutatingVariableInputs(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.BoolFlags, + a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) + return 0 + + # Operator + def MutatingVariableInputsAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o) + return 0 + + # Operator + def MutatingVariableInputsLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + def OperatorStart(builder): - builder.StartObject(7) + builder.StartObject(8) def OperatorAddOpcodeIndex(builder, opcodeIndex): @@ -171,5 +195,14 @@ def OperatorAddCustomOptionsFormat(builder, customOptionsFormat): builder.PrependInt8Slot(6, customOptionsFormat, 0) +def OperatorAddMutatingVariableInputs(builder, mutatingVariableInputs): + builder.PrependUOffsetTRelativeSlot( + 7, flatbuffers.number_types.UOffsetTFlags.py_type(mutatingVariableInputs), 0) + + +def OperatorStartMutatingVariableInputsVector(builder, numElems): + return builder.StartVector(1, numElems, 1) + + def OperatorEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/OperatorCode.py b/tools/tflitefile_tool/tflite/OperatorCode.py index f4b09b6..0f945b9 100644 --- a/tools/tflitefile_tool/tflite/OperatorCode.py +++ b/tools/tflitefile_tool/tflite/OperatorCode.py @@ -31,7 +31,7 @@ class OperatorCode(object): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.String(o + self._tab.Pos) - return bytes() + return "" # OperatorCode def Version(self): diff --git a/tools/tflitefile_tool/tflite/PowOptions.py b/tools/tflitefile_tool/tflite/PowOptions.py new file mode 100644 index 0000000..8368ac5 --- /dev/null +++ b/tools/tflitefile_tool/tflite/PowOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class PowOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPowOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = PowOptions() + x.Init(buf, n + offset) + return x + + # PowOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def PowOptionsStart(builder): + builder.StartObject(0) + + +def PowOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/ReducerOptions.py b/tools/tflitefile_tool/tflite/ReducerOptions.py new file mode 100644 index 0000000..5b6fa1a --- /dev/null +++ b/tools/tflitefile_tool/tflite/ReducerOptions.py @@ -0,0 +1,39 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class ReducerOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsReducerOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ReducerOptions() + x.Init(buf, n + offset) + return x + + # ReducerOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ReducerOptions + def KeepDims(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos) + return 0 + + +def ReducerOptionsStart(builder): + builder.StartObject(1) + + +def ReducerOptionsAddKeepDims(builder, keepDims): + builder.PrependBoolSlot(0, keepDims, 0) + + +def ReducerOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/ShapeOptions.py b/tools/tflitefile_tool/tflite/ShapeOptions.py new file mode 100644 index 0000000..939e27b --- /dev/null +++ b/tools/tflitefile_tool/tflite/ShapeOptions.py @@ -0,0 +1,39 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class ShapeOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsShapeOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ShapeOptions() + x.Init(buf, n + offset) + return x + + # ShapeOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ShapeOptions + def OutType(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 + + +def ShapeOptionsStart(builder): + builder.StartObject(1) + + +def ShapeOptionsAddOutType(builder, outType): + builder.PrependInt8Slot(0, outType, 0) + + +def ShapeOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/SubGraph.py b/tools/tflitefile_tool/tflite/SubGraph.py index 3e568e1..c20880a 100644 --- a/tools/tflitefile_tool/tflite/SubGraph.py +++ b/tools/tflitefile_tool/tflite/SubGraph.py @@ -112,7 +112,7 @@ class SubGraph(object): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) if o != 0: return self._tab.String(o + self._tab.Pos) - return bytes() + return "" def SubGraphStart(builder): diff --git a/tools/tflitefile_tool/tflite/Tensor.py b/tools/tflitefile_tool/tflite/Tensor.py index 730e42f..468b120 100644 --- a/tools/tflitefile_tool/tflite/Tensor.py +++ b/tools/tflitefile_tool/tflite/Tensor.py @@ -62,7 +62,7 @@ class Tensor(object): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.String(o + self._tab.Pos) - return bytes() + return "" # Tensor def Quantization(self): @@ -75,9 +75,16 @@ class Tensor(object): return obj return None + # Tensor + def IsVariable(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos) + return 0 + def TensorStart(builder): - builder.StartObject(5) + builder.StartObject(6) def TensorAddShape(builder, shape): @@ -107,5 +114,9 @@ def TensorAddQuantization(builder, quantization): 4, flatbuffers.number_types.UOffsetTFlags.py_type(quantization), 0) +def TensorAddIsVariable(builder, isVariable): + builder.PrependBoolSlot(5, isVariable, 0) + + def TensorEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/TensorType.py b/tools/tflitefile_tool/tflite/TensorType.py index e0f1542..e375c65 100644 --- a/tools/tflitefile_tool/tflite/TensorType.py +++ b/tools/tflitefile_tool/tflite/TensorType.py @@ -11,3 +11,5 @@ class TensorType(object): INT64 = 4 STRING = 5 BOOL = 6 + INT16 = 7 + COMPLEX64 = 8 diff --git a/tools/tflitefile_tool/tflite/TileOptions.py b/tools/tflitefile_tool/tflite/TileOptions.py new file mode 100644 index 0000000..59543fc --- /dev/null +++ b/tools/tflitefile_tool/tflite/TileOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class TileOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTileOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = TileOptions() + x.Init(buf, n + offset) + return x + + # TileOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def TileOptionsStart(builder): + builder.StartObject(0) + + +def TileOptionsEnd(builder): + return builder.EndObject() -- 2.7.4