Helper python code for TFLite model file parsing
authorHyeongseok Oh <hseok82.oh@samsung.com>
Thu, 22 Mar 2018 10:02:42 +0000 (19:02 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Mon, 26 Mar 2018 04:49:21 +0000 (13:49 +0900)
Include generated python helper by flatc with schema in tools/tflitefile_tool/tflite

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
52 files changed:
tools/tflitefile_tool/tflite/ActivationFunctionType.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/AddOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/BatchToSpaceNDOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/BidirectionalSequenceRNNOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Buffer.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/BuiltinOperator.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/BuiltinOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/CallOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/CombinerType.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/ConcatEmbeddingsOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/ConcatenationOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Conv2DOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/CustomOptionsFormat.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/DepthwiseConv2DOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/DivOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/EmbeddingLookupSparseOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/ExpOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/FullyConnectedOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/GatherOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/L2NormOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/LSHProjectionOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/LSHProjectionType.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/LSTMOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/LocalResponseNormalizationOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/MeanOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Model.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/MulOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Operator.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/OperatorCode.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/PadOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Padding.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Pool2DOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/QuantizationParameters.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/RNNOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/ReshapeOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/ResizeBilinearOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SVDFOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SequenceRNNOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SkipGramOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SoftmaxOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SpaceToBatchNDOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SpaceToDepthOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SplitOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SqueezeOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/StridedSliceOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SubGraph.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/SubOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/Tensor.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/TensorType.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/TopKV2Options.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/TransposeOptions.py [new file with mode: 0644]
tools/tflitefile_tool/tflite/__init__.py [new file with mode: 0644]

diff --git a/tools/tflitefile_tool/tflite/ActivationFunctionType.py b/tools/tflitefile_tool/tflite/ActivationFunctionType.py
new file mode 100644 (file)
index 0000000..dc177de
--- /dev/null
@@ -0,0 +1,12 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class ActivationFunctionType(object):
+    NONE = 0
+    RELU = 1
+    RELU_N1_TO_1 = 2
+    RELU6 = 3
+    TANH = 4
+    SIGN_BIT = 5
+
diff --git a/tools/tflitefile_tool/tflite/AddOptions.py b/tools/tflitefile_tool/tflite/AddOptions.py
new file mode 100644 (file)
index 0000000..d6cbfcf
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class AddOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsAddOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = AddOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # AddOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # AddOptions
+    def FusedActivationFunction(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 AddOptionsStart(builder): builder.StartObject(1)
+def AddOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def AddOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/BatchToSpaceNDOptions.py b/tools/tflitefile_tool/tflite/BatchToSpaceNDOptions.py
new file mode 100644 (file)
index 0000000..3ddcfd3
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class BatchToSpaceNDOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsBatchToSpaceNDOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = BatchToSpaceNDOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # BatchToSpaceNDOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def BatchToSpaceNDOptionsStart(builder): builder.StartObject(0)
+def BatchToSpaceNDOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/BidirectionalSequenceRNNOptions.py b/tools/tflitefile_tool/tflite/BidirectionalSequenceRNNOptions.py
new file mode 100644 (file)
index 0000000..8b32fcb
--- /dev/null
@@ -0,0 +1,38 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class BidirectionalSequenceRNNOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsBidirectionalSequenceRNNOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = BidirectionalSequenceRNNOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # BidirectionalSequenceRNNOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # BidirectionalSequenceRNNOptions
+    def TimeMajor(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
+
+    # BidirectionalSequenceRNNOptions
+    def FusedActivationFunction(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 BidirectionalSequenceRNNOptionsStart(builder): builder.StartObject(2)
+def BidirectionalSequenceRNNOptionsAddTimeMajor(builder, timeMajor): builder.PrependBoolSlot(0, timeMajor, 0)
+def BidirectionalSequenceRNNOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0)
+def BidirectionalSequenceRNNOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Buffer.py b/tools/tflitefile_tool/tflite/Buffer.py
new file mode 100644 (file)
index 0000000..754dee3
--- /dev/null
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Buffer(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsBuffer(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Buffer()
+        x.Init(buf, n + offset)
+        return x
+
+    # Buffer
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Buffer
+    def Data(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.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
+        return 0
+
+    # Buffer
+    def DataAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
+        return 0
+
+    # Buffer
+    def DataLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def BufferStart(builder): builder.StartObject(1)
+def BufferAddData(builder, data): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(data), 0)
+def BufferStartDataVector(builder, numElems): return builder.StartVector(1, numElems, 1)
+def BufferEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/BuiltinOperator.py b/tools/tflitefile_tool/tflite/BuiltinOperator.py
new file mode 100644 (file)
index 0000000..e68c78c
--- /dev/null
@@ -0,0 +1,53 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class BuiltinOperator(object):
+    ADD = 0
+    AVERAGE_POOL_2D = 1
+    CONCATENATION = 2
+    CONV_2D = 3
+    DEPTHWISE_CONV_2D = 4
+    EMBEDDING_LOOKUP = 7
+    FULLY_CONNECTED = 9
+    HASHTABLE_LOOKUP = 10
+    L2_NORMALIZATION = 11
+    L2_POOL_2D = 12
+    LOCAL_RESPONSE_NORMALIZATION = 13
+    LOGISTIC = 14
+    LSH_PROJECTION = 15
+    LSTM = 16
+    MAX_POOL_2D = 17
+    MUL = 18
+    RELU = 19
+    RELU_N1_TO_1 = 20
+    RELU6 = 21
+    RESHAPE = 22
+    RESIZE_BILINEAR = 23
+    RNN = 24
+    SOFTMAX = 25
+    SPACE_TO_DEPTH = 26
+    SVDF = 27
+    TANH = 28
+    CONCAT_EMBEDDINGS = 29
+    SKIP_GRAM = 30
+    CALL = 31
+    CUSTOM = 32
+    EMBEDDING_LOOKUP_SPARSE = 33
+    PAD = 34
+    UNIDIRECTIONAL_SEQUENCE_RNN = 35
+    GATHER = 36
+    BATCH_TO_SPACE_ND = 37
+    SPACE_TO_BATCH_ND = 38
+    TRANSPOSE = 39
+    MEAN = 40
+    SUB = 41
+    DIV = 42
+    SQUEEZE = 43
+    UNIDIRECTIONAL_SEQUENCE_LSTM = 44
+    STRIDED_SLICE = 45
+    BIDIRECTIONAL_SEQUENCE_RNN = 46
+    EXP = 47
+    TOPK_V2 = 48
+    SPLIT = 49
+
diff --git a/tools/tflitefile_tool/tflite/BuiltinOptions.py b/tools/tflitefile_tool/tflite/BuiltinOptions.py
new file mode 100644 (file)
index 0000000..5bd34f8
--- /dev/null
@@ -0,0 +1,42 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class BuiltinOptions(object):
+    NONE = 0
+    Conv2DOptions = 1
+    DepthwiseConv2DOptions = 2
+    ConcatEmbeddingsOptions = 3
+    LSHProjectionOptions = 4
+    Pool2DOptions = 5
+    SVDFOptions = 6
+    RNNOptions = 7
+    FullyConnectedOptions = 8
+    SoftmaxOptions = 9
+    ConcatenationOptions = 10
+    AddOptions = 11
+    L2NormOptions = 12
+    LocalResponseNormalizationOptions = 13
+    LSTMOptions = 14
+    ResizeBilinearOptions = 15
+    CallOptions = 16
+    ReshapeOptions = 17
+    SkipGramOptions = 18
+    SpaceToDepthOptions = 19
+    EmbeddingLookupSparseOptions = 20
+    MulOptions = 21
+    PadOptions = 22
+    GatherOptions = 23
+    BatchToSpaceNDOptions = 24
+    SpaceToBatchNDOptions = 25
+    TransposeOptions = 26
+    MeanOptions = 27
+    SubOptions = 28
+    DivOptions = 29
+    SqueezeOptions = 30
+    SequenceRNNOptions = 31
+    StridedSliceOptions = 32
+    ExpOptions = 33
+    TopKV2Options = 34
+    SplitOptions = 35
+
diff --git a/tools/tflitefile_tool/tflite/CallOptions.py b/tools/tflitefile_tool/tflite/CallOptions.py
new file mode 100644 (file)
index 0000000..5ae2eea
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class CallOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsCallOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = CallOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # CallOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # CallOptions
+    def Subgraph(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
+        return 0
+
+def CallOptionsStart(builder): builder.StartObject(1)
+def CallOptionsAddSubgraph(builder, subgraph): builder.PrependUint32Slot(0, subgraph, 0)
+def CallOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/CombinerType.py b/tools/tflitefile_tool/tflite/CombinerType.py
new file mode 100644 (file)
index 0000000..17d9151
--- /dev/null
@@ -0,0 +1,9 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class CombinerType(object):
+    SUM = 0
+    MEAN = 1
+    SQRTN = 2
+
diff --git a/tools/tflitefile_tool/tflite/ConcatEmbeddingsOptions.py b/tools/tflitefile_tool/tflite/ConcatEmbeddingsOptions.py
new file mode 100644 (file)
index 0000000..9d26c51
--- /dev/null
@@ -0,0 +1,78 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class ConcatEmbeddingsOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsConcatEmbeddingsOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = ConcatEmbeddingsOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # ConcatEmbeddingsOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # ConcatEmbeddingsOptions
+    def NumChannels(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
+
+    # ConcatEmbeddingsOptions
+    def NumColumnsPerChannel(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
+
+    # ConcatEmbeddingsOptions
+    def NumColumnsPerChannelAsNumpy(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
+
+    # ConcatEmbeddingsOptions
+    def NumColumnsPerChannelLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # ConcatEmbeddingsOptions
+    def EmbeddingDimPerChannel(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
+
+    # ConcatEmbeddingsOptions
+    def EmbeddingDimPerChannelAsNumpy(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
+
+    # ConcatEmbeddingsOptions
+    def EmbeddingDimPerChannelLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def ConcatEmbeddingsOptionsStart(builder): builder.StartObject(3)
+def ConcatEmbeddingsOptionsAddNumChannels(builder, numChannels): builder.PrependInt32Slot(0, numChannels, 0)
+def ConcatEmbeddingsOptionsAddNumColumnsPerChannel(builder, numColumnsPerChannel): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(numColumnsPerChannel), 0)
+def ConcatEmbeddingsOptionsStartNumColumnsPerChannelVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ConcatEmbeddingsOptionsAddEmbeddingDimPerChannel(builder, embeddingDimPerChannel): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(embeddingDimPerChannel), 0)
+def ConcatEmbeddingsOptionsStartEmbeddingDimPerChannelVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ConcatEmbeddingsOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/ConcatenationOptions.py b/tools/tflitefile_tool/tflite/ConcatenationOptions.py
new file mode 100644 (file)
index 0000000..c8e0b6a
--- /dev/null
@@ -0,0 +1,38 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class ConcatenationOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsConcatenationOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = ConcatenationOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # ConcatenationOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # ConcatenationOptions
+    def Axis(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
+
+    # ConcatenationOptions
+    def FusedActivationFunction(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 ConcatenationOptionsStart(builder): builder.StartObject(2)
+def ConcatenationOptionsAddAxis(builder, axis): builder.PrependInt32Slot(0, axis, 0)
+def ConcatenationOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0)
+def ConcatenationOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Conv2DOptions.py b/tools/tflitefile_tool/tflite/Conv2DOptions.py
new file mode 100644 (file)
index 0000000..004e400
--- /dev/null
@@ -0,0 +1,54 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Conv2DOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsConv2DOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Conv2DOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # Conv2DOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Conv2DOptions
+    def Padding(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
+
+    # Conv2DOptions
+    def StrideW(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # Conv2DOptions
+    def StrideH(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
+
+    # Conv2DOptions
+    def FusedActivationFunction(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 Conv2DOptionsStart(builder): builder.StartObject(4)
+def Conv2DOptionsAddPadding(builder, padding): builder.PrependInt8Slot(0, padding, 0)
+def Conv2DOptionsAddStrideW(builder, strideW): builder.PrependInt32Slot(1, strideW, 0)
+def Conv2DOptionsAddStrideH(builder, strideH): builder.PrependInt32Slot(2, strideH, 0)
+def Conv2DOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(3, fusedActivationFunction, 0)
+def Conv2DOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/CustomOptionsFormat.py b/tools/tflitefile_tool/tflite/CustomOptionsFormat.py
new file mode 100644 (file)
index 0000000..bef384c
--- /dev/null
@@ -0,0 +1,7 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class CustomOptionsFormat(object):
+    FLEXBUFFERS = 0
+
diff --git a/tools/tflitefile_tool/tflite/DepthwiseConv2DOptions.py b/tools/tflitefile_tool/tflite/DepthwiseConv2DOptions.py
new file mode 100644 (file)
index 0000000..002d583
--- /dev/null
@@ -0,0 +1,62 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class DepthwiseConv2DOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsDepthwiseConv2DOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = DepthwiseConv2DOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # DepthwiseConv2DOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # DepthwiseConv2DOptions
+    def Padding(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
+
+    # DepthwiseConv2DOptions
+    def StrideW(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # DepthwiseConv2DOptions
+    def StrideH(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
+
+    # DepthwiseConv2DOptions
+    def DepthMultiplier(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
+
+    # DepthwiseConv2DOptions
+    def FusedActivationFunction(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
+        return 0
+
+def DepthwiseConv2DOptionsStart(builder): builder.StartObject(5)
+def DepthwiseConv2DOptionsAddPadding(builder, padding): builder.PrependInt8Slot(0, padding, 0)
+def DepthwiseConv2DOptionsAddStrideW(builder, strideW): builder.PrependInt32Slot(1, strideW, 0)
+def DepthwiseConv2DOptionsAddStrideH(builder, strideH): builder.PrependInt32Slot(2, strideH, 0)
+def DepthwiseConv2DOptionsAddDepthMultiplier(builder, depthMultiplier): builder.PrependInt32Slot(3, depthMultiplier, 0)
+def DepthwiseConv2DOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(4, fusedActivationFunction, 0)
+def DepthwiseConv2DOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/DivOptions.py b/tools/tflitefile_tool/tflite/DivOptions.py
new file mode 100644 (file)
index 0000000..905a3be
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class DivOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsDivOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = DivOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # DivOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # DivOptions
+    def FusedActivationFunction(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 DivOptionsStart(builder): builder.StartObject(1)
+def DivOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def DivOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/EmbeddingLookupSparseOptions.py b/tools/tflitefile_tool/tflite/EmbeddingLookupSparseOptions.py
new file mode 100644 (file)
index 0000000..7d9c144
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class EmbeddingLookupSparseOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsEmbeddingLookupSparseOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = EmbeddingLookupSparseOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # EmbeddingLookupSparseOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # EmbeddingLookupSparseOptions
+    def Combiner(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 EmbeddingLookupSparseOptionsStart(builder): builder.StartObject(1)
+def EmbeddingLookupSparseOptionsAddCombiner(builder, combiner): builder.PrependInt8Slot(0, combiner, 0)
+def EmbeddingLookupSparseOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/ExpOptions.py b/tools/tflitefile_tool/tflite/ExpOptions.py
new file mode 100644 (file)
index 0000000..eac1456
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class ExpOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsExpOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = ExpOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # ExpOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def ExpOptionsStart(builder): builder.StartObject(0)
+def ExpOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/FullyConnectedOptions.py b/tools/tflitefile_tool/tflite/FullyConnectedOptions.py
new file mode 100644 (file)
index 0000000..ffab6b8
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class FullyConnectedOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsFullyConnectedOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = FullyConnectedOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # FullyConnectedOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # FullyConnectedOptions
+    def FusedActivationFunction(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 FullyConnectedOptionsStart(builder): builder.StartObject(1)
+def FullyConnectedOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def FullyConnectedOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/GatherOptions.py b/tools/tflitefile_tool/tflite/GatherOptions.py
new file mode 100644 (file)
index 0000000..9fbc3e4
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class GatherOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsGatherOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = GatherOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # GatherOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # GatherOptions
+    def Axis(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
+
+def GatherOptionsStart(builder): builder.StartObject(1)
+def GatherOptionsAddAxis(builder, axis): builder.PrependInt32Slot(0, axis, 0)
+def GatherOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/L2NormOptions.py b/tools/tflitefile_tool/tflite/L2NormOptions.py
new file mode 100644 (file)
index 0000000..38bdf57
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class L2NormOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsL2NormOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = L2NormOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # L2NormOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # L2NormOptions
+    def FusedActivationFunction(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 L2NormOptionsStart(builder): builder.StartObject(1)
+def L2NormOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def L2NormOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/LSHProjectionOptions.py b/tools/tflitefile_tool/tflite/LSHProjectionOptions.py
new file mode 100644 (file)
index 0000000..ad550be
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class LSHProjectionOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsLSHProjectionOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = LSHProjectionOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # LSHProjectionOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # LSHProjectionOptions
+    def Type(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 LSHProjectionOptionsStart(builder): builder.StartObject(1)
+def LSHProjectionOptionsAddType(builder, type): builder.PrependInt8Slot(0, type, 0)
+def LSHProjectionOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/LSHProjectionType.py b/tools/tflitefile_tool/tflite/LSHProjectionType.py
new file mode 100644 (file)
index 0000000..d6a136e
--- /dev/null
@@ -0,0 +1,9 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class LSHProjectionType(object):
+    UNKNOWN = 0
+    SPARSE = 1
+    DENSE = 2
+
diff --git a/tools/tflitefile_tool/tflite/LSTMOptions.py b/tools/tflitefile_tool/tflite/LSTMOptions.py
new file mode 100644 (file)
index 0000000..06c43ec
--- /dev/null
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class LSTMOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsLSTMOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = LSTMOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # LSTMOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # LSTMOptions
+    def FusedActivationFunction(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
+
+    # LSTMOptions
+    def CellClip(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
+
+    # LSTMOptions
+    def ProjClip(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
+        return 0.0
+
+def LSTMOptionsStart(builder): builder.StartObject(3)
+def LSTMOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def LSTMOptionsAddCellClip(builder, cellClip): builder.PrependFloat32Slot(1, cellClip, 0.0)
+def LSTMOptionsAddProjClip(builder, projClip): builder.PrependFloat32Slot(2, projClip, 0.0)
+def LSTMOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/LocalResponseNormalizationOptions.py b/tools/tflitefile_tool/tflite/LocalResponseNormalizationOptions.py
new file mode 100644 (file)
index 0000000..db87560
--- /dev/null
@@ -0,0 +1,54 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class LocalResponseNormalizationOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsLocalResponseNormalizationOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = LocalResponseNormalizationOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # LocalResponseNormalizationOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # LocalResponseNormalizationOptions
+    def Radius(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
+
+    # LocalResponseNormalizationOptions
+    def Bias(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
+
+    # LocalResponseNormalizationOptions
+    def Alpha(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
+        return 0.0
+
+    # LocalResponseNormalizationOptions
+    def Beta(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
+        return 0.0
+
+def LocalResponseNormalizationOptionsStart(builder): builder.StartObject(4)
+def LocalResponseNormalizationOptionsAddRadius(builder, radius): builder.PrependInt32Slot(0, radius, 0)
+def LocalResponseNormalizationOptionsAddBias(builder, bias): builder.PrependFloat32Slot(1, bias, 0.0)
+def LocalResponseNormalizationOptionsAddAlpha(builder, alpha): builder.PrependFloat32Slot(2, alpha, 0.0)
+def LocalResponseNormalizationOptionsAddBeta(builder, beta): builder.PrependFloat32Slot(3, beta, 0.0)
+def LocalResponseNormalizationOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/MeanOptions.py b/tools/tflitefile_tool/tflite/MeanOptions.py
new file mode 100644 (file)
index 0000000..d884e05
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class MeanOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsMeanOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = MeanOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # MeanOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # MeanOptions
+    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 MeanOptionsStart(builder): builder.StartObject(1)
+def MeanOptionsAddKeepDims(builder, keepDims): builder.PrependBoolSlot(0, keepDims, 0)
+def MeanOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Model.py b/tools/tflitefile_tool/tflite/Model.py
new file mode 100644 (file)
index 0000000..9b24555
--- /dev/null
@@ -0,0 +1,104 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Model(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsModel(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Model()
+        x.Init(buf, n + offset)
+        return x
+
+    # Model
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Model
+    def Version(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
+        return 0
+
+    # Model
+    def OperatorCodes(self, j):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            x = self._tab.Vector(o)
+            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
+            x = self._tab.Indirect(x)
+            from .OperatorCode import OperatorCode
+            obj = OperatorCode()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+    # Model
+    def OperatorCodesLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Model
+    def Subgraphs(self, j):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            x = self._tab.Vector(o)
+            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
+            x = self._tab.Indirect(x)
+            from .SubGraph import SubGraph
+            obj = SubGraph()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+    # Model
+    def SubgraphsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Model
+    def Description(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.String(o + self._tab.Pos)
+        return bytes()
+
+    # Model
+    def Buffers(self, j):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            x = self._tab.Vector(o)
+            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
+            x = self._tab.Indirect(x)
+            from .Buffer import Buffer
+            obj = Buffer()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+    # Model
+    def BuffersLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def ModelStart(builder): builder.StartObject(5)
+def ModelAddVersion(builder, version): builder.PrependUint32Slot(0, version, 0)
+def ModelAddOperatorCodes(builder, operatorCodes): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(operatorCodes), 0)
+def ModelStartOperatorCodesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ModelAddSubgraphs(builder, subgraphs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(subgraphs), 0)
+def ModelStartSubgraphsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ModelAddDescription(builder, description): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(description), 0)
+def ModelAddBuffers(builder, buffers): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(buffers), 0)
+def ModelStartBuffersVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ModelEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/MulOptions.py b/tools/tflitefile_tool/tflite/MulOptions.py
new file mode 100644 (file)
index 0000000..55b9506
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class MulOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsMulOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = MulOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # MulOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # MulOptions
+    def FusedActivationFunction(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 MulOptionsStart(builder): builder.StartObject(1)
+def MulOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def MulOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Operator.py b/tools/tflitefile_tool/tflite/Operator.py
new file mode 100644 (file)
index 0000000..881a6ed
--- /dev/null
@@ -0,0 +1,129 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Operator(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsOperator(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Operator()
+        x.Init(buf, n + offset)
+        return x
+
+    # Operator
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Operator
+    def OpcodeIndex(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
+        return 0
+
+    # Operator
+    def Inputs(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
+
+    # Operator
+    def InputsAsNumpy(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
+
+    # Operator
+    def InputsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Operator
+    def Outputs(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
+
+    # Operator
+    def OutputsAsNumpy(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
+
+    # Operator
+    def OutputsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Operator
+    def BuiltinOptionsType(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
+        return 0
+
+    # Operator
+    def BuiltinOptions(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            from flatbuffers.table import Table
+            obj = Table(bytearray(), 0)
+            self._tab.Union(obj, o)
+            return obj
+        return None
+
+    # Operator
+    def CustomOptions(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.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
+        return 0
+
+    # Operator
+    def CustomOptionsAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
+        return 0
+
+    # Operator
+    def CustomOptionsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Operator
+    def CustomOptionsFormat(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 0
+
+def OperatorStart(builder): builder.StartObject(7)
+def OperatorAddOpcodeIndex(builder, opcodeIndex): builder.PrependUint32Slot(0, opcodeIndex, 0)
+def OperatorAddInputs(builder, inputs): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(inputs), 0)
+def OperatorStartInputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def OperatorAddOutputs(builder, outputs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(outputs), 0)
+def OperatorStartOutputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def OperatorAddBuiltinOptionsType(builder, builtinOptionsType): builder.PrependUint8Slot(3, builtinOptionsType, 0)
+def OperatorAddBuiltinOptions(builder, builtinOptions): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(builtinOptions), 0)
+def OperatorAddCustomOptions(builder, customOptions): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(customOptions), 0)
+def OperatorStartCustomOptionsVector(builder, numElems): return builder.StartVector(1, numElems, 1)
+def OperatorAddCustomOptionsFormat(builder, customOptionsFormat): builder.PrependInt8Slot(6, customOptionsFormat, 0)
+def OperatorEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/OperatorCode.py b/tools/tflitefile_tool/tflite/OperatorCode.py
new file mode 100644 (file)
index 0000000..68ddc58
--- /dev/null
@@ -0,0 +1,38 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class OperatorCode(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsOperatorCode(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = OperatorCode()
+        x.Init(buf, n + offset)
+        return x
+
+    # OperatorCode
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # OperatorCode
+    def BuiltinCode(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
+
+    # OperatorCode
+    def CustomCode(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.String(o + self._tab.Pos)
+        return bytes()
+
+def OperatorCodeStart(builder): builder.StartObject(2)
+def OperatorCodeAddBuiltinCode(builder, builtinCode): builder.PrependInt8Slot(0, builtinCode, 0)
+def OperatorCodeAddCustomCode(builder, customCode): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(customCode), 0)
+def OperatorCodeEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/PadOptions.py b/tools/tflitefile_tool/tflite/PadOptions.py
new file mode 100644 (file)
index 0000000..d0833c6
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class PadOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsPadOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = PadOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # PadOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def PadOptionsStart(builder): builder.StartObject(0)
+def PadOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Padding.py b/tools/tflitefile_tool/tflite/Padding.py
new file mode 100644 (file)
index 0000000..6027f4b
--- /dev/null
@@ -0,0 +1,8 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class Padding(object):
+    SAME = 0
+    VALID = 1
+
diff --git a/tools/tflitefile_tool/tflite/Pool2DOptions.py b/tools/tflitefile_tool/tflite/Pool2DOptions.py
new file mode 100644 (file)
index 0000000..b8b9f17
--- /dev/null
@@ -0,0 +1,70 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Pool2DOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsPool2DOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Pool2DOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # Pool2DOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Pool2DOptions
+    def Padding(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
+
+    # Pool2DOptions
+    def StrideW(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # Pool2DOptions
+    def StrideH(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
+
+    # Pool2DOptions
+    def FilterWidth(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
+
+    # Pool2DOptions
+    def FilterHeight(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # Pool2DOptions
+    def FusedActivationFunction(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
+        return 0
+
+def Pool2DOptionsStart(builder): builder.StartObject(6)
+def Pool2DOptionsAddPadding(builder, padding): builder.PrependInt8Slot(0, padding, 0)
+def Pool2DOptionsAddStrideW(builder, strideW): builder.PrependInt32Slot(1, strideW, 0)
+def Pool2DOptionsAddStrideH(builder, strideH): builder.PrependInt32Slot(2, strideH, 0)
+def Pool2DOptionsAddFilterWidth(builder, filterWidth): builder.PrependInt32Slot(3, filterWidth, 0)
+def Pool2DOptionsAddFilterHeight(builder, filterHeight): builder.PrependInt32Slot(4, filterHeight, 0)
+def Pool2DOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(5, fusedActivationFunction, 0)
+def Pool2DOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/QuantizationParameters.py b/tools/tflitefile_tool/tflite/QuantizationParameters.py
new file mode 100644 (file)
index 0000000..a7e7efa
--- /dev/null
@@ -0,0 +1,118 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class QuantizationParameters(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsQuantizationParameters(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = QuantizationParameters()
+        x.Init(buf, n + offset)
+        return x
+
+    # QuantizationParameters
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # QuantizationParameters
+    def Min(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.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+        return 0
+
+    # QuantizationParameters
+    def MinAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
+        return 0
+
+    # QuantizationParameters
+    def MinLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # QuantizationParameters
+    def Max(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.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+        return 0
+
+    # QuantizationParameters
+    def MaxAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
+        return 0
+
+    # QuantizationParameters
+    def MaxLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # QuantizationParameters
+    def Scale(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.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
+        return 0
+
+    # QuantizationParameters
+    def ScaleAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
+        return 0
+
+    # QuantizationParameters
+    def ScaleLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # QuantizationParameters
+    def ZeroPoint(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.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
+        return 0
+
+    # QuantizationParameters
+    def ZeroPointAsNumpy(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
+        return 0
+
+    # QuantizationParameters
+    def ZeroPointLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def QuantizationParametersStart(builder): builder.StartObject(4)
+def QuantizationParametersAddMin(builder, min): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(min), 0)
+def QuantizationParametersStartMinVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def QuantizationParametersAddMax(builder, max): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(max), 0)
+def QuantizationParametersStartMaxVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def QuantizationParametersAddScale(builder, scale): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(scale), 0)
+def QuantizationParametersStartScaleVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def QuantizationParametersAddZeroPoint(builder, zeroPoint): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(zeroPoint), 0)
+def QuantizationParametersStartZeroPointVector(builder, numElems): return builder.StartVector(8, numElems, 8)
+def QuantizationParametersEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/RNNOptions.py b/tools/tflitefile_tool/tflite/RNNOptions.py
new file mode 100644 (file)
index 0000000..3cfdb6a
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class RNNOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsRNNOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = RNNOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # RNNOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # RNNOptions
+    def FusedActivationFunction(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 RNNOptionsStart(builder): builder.StartObject(1)
+def RNNOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def RNNOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/ReshapeOptions.py b/tools/tflitefile_tool/tflite/ReshapeOptions.py
new file mode 100644 (file)
index 0000000..157d45d
--- /dev/null
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class ReshapeOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsReshapeOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = ReshapeOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # ReshapeOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # ReshapeOptions
+    def NewShape(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
+
+    # ReshapeOptions
+    def NewShapeAsNumpy(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
+
+    # ReshapeOptions
+    def NewShapeLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def ReshapeOptionsStart(builder): builder.StartObject(1)
+def ReshapeOptionsAddNewShape(builder, newShape): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(newShape), 0)
+def ReshapeOptionsStartNewShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def ReshapeOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/ResizeBilinearOptions.py b/tools/tflitefile_tool/tflite/ResizeBilinearOptions.py
new file mode 100644 (file)
index 0000000..8d81b1d
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class ResizeBilinearOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsResizeBilinearOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = ResizeBilinearOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # ResizeBilinearOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # ResizeBilinearOptions
+    def AlignCorners(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
+        return 0
+
+def ResizeBilinearOptionsStart(builder): builder.StartObject(3)
+def ResizeBilinearOptionsAddAlignCorners(builder, alignCorners): builder.PrependBoolSlot(2, alignCorners, 0)
+def ResizeBilinearOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SVDFOptions.py b/tools/tflitefile_tool/tflite/SVDFOptions.py
new file mode 100644 (file)
index 0000000..6f391db
--- /dev/null
@@ -0,0 +1,38 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SVDFOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSVDFOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SVDFOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SVDFOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SVDFOptions
+    def Rank(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
+
+    # SVDFOptions
+    def FusedActivationFunction(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 SVDFOptionsStart(builder): builder.StartObject(2)
+def SVDFOptionsAddRank(builder, rank): builder.PrependInt32Slot(0, rank, 0)
+def SVDFOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0)
+def SVDFOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SequenceRNNOptions.py b/tools/tflitefile_tool/tflite/SequenceRNNOptions.py
new file mode 100644 (file)
index 0000000..87b0961
--- /dev/null
@@ -0,0 +1,38 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SequenceRNNOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSequenceRNNOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SequenceRNNOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SequenceRNNOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SequenceRNNOptions
+    def TimeMajor(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
+
+    # SequenceRNNOptions
+    def FusedActivationFunction(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 SequenceRNNOptionsStart(builder): builder.StartObject(2)
+def SequenceRNNOptionsAddTimeMajor(builder, timeMajor): builder.PrependBoolSlot(0, timeMajor, 0)
+def SequenceRNNOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(1, fusedActivationFunction, 0)
+def SequenceRNNOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SkipGramOptions.py b/tools/tflitefile_tool/tflite/SkipGramOptions.py
new file mode 100644 (file)
index 0000000..27b2c40
--- /dev/null
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SkipGramOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSkipGramOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SkipGramOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SkipGramOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SkipGramOptions
+    def NgramSize(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
+
+    # SkipGramOptions
+    def MaxSkipSize(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # SkipGramOptions
+    def IncludeAllNgrams(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
+        return 0
+
+def SkipGramOptionsStart(builder): builder.StartObject(3)
+def SkipGramOptionsAddNgramSize(builder, ngramSize): builder.PrependInt32Slot(0, ngramSize, 0)
+def SkipGramOptionsAddMaxSkipSize(builder, maxSkipSize): builder.PrependInt32Slot(1, maxSkipSize, 0)
+def SkipGramOptionsAddIncludeAllNgrams(builder, includeAllNgrams): builder.PrependBoolSlot(2, includeAllNgrams, 0)
+def SkipGramOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SoftmaxOptions.py b/tools/tflitefile_tool/tflite/SoftmaxOptions.py
new file mode 100644 (file)
index 0000000..a716853
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SoftmaxOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSoftmaxOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SoftmaxOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SoftmaxOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SoftmaxOptions
+    def Beta(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
+
+def SoftmaxOptionsStart(builder): builder.StartObject(1)
+def SoftmaxOptionsAddBeta(builder, beta): builder.PrependFloat32Slot(0, beta, 0.0)
+def SoftmaxOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SpaceToBatchNDOptions.py b/tools/tflitefile_tool/tflite/SpaceToBatchNDOptions.py
new file mode 100644 (file)
index 0000000..b61ef96
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SpaceToBatchNDOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSpaceToBatchNDOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SpaceToBatchNDOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SpaceToBatchNDOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def SpaceToBatchNDOptionsStart(builder): builder.StartObject(0)
+def SpaceToBatchNDOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SpaceToDepthOptions.py b/tools/tflitefile_tool/tflite/SpaceToDepthOptions.py
new file mode 100644 (file)
index 0000000..d571174
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SpaceToDepthOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSpaceToDepthOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SpaceToDepthOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SpaceToDepthOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SpaceToDepthOptions
+    def BlockSize(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
+
+def SpaceToDepthOptionsStart(builder): builder.StartObject(1)
+def SpaceToDepthOptionsAddBlockSize(builder, blockSize): builder.PrependInt32Slot(0, blockSize, 0)
+def SpaceToDepthOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SplitOptions.py b/tools/tflitefile_tool/tflite/SplitOptions.py
new file mode 100644 (file)
index 0000000..3207525
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SplitOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSplitOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SplitOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SplitOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SplitOptions
+    def NumSplits(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
+
+def SplitOptionsStart(builder): builder.StartObject(1)
+def SplitOptionsAddNumSplits(builder, numSplits): builder.PrependInt32Slot(0, numSplits, 0)
+def SplitOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SqueezeOptions.py b/tools/tflitefile_tool/tflite/SqueezeOptions.py
new file mode 100644 (file)
index 0000000..25b294d
--- /dev/null
@@ -0,0 +1,46 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SqueezeOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSqueezeOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SqueezeOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SqueezeOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SqueezeOptions
+    def SqueezeDims(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
+
+    # SqueezeOptions
+    def SqueezeDimsAsNumpy(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
+
+    # SqueezeOptions
+    def SqueezeDimsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+def SqueezeOptionsStart(builder): builder.StartObject(1)
+def SqueezeOptionsAddSqueezeDims(builder, squeezeDims): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(squeezeDims), 0)
+def SqueezeOptionsStartSqueezeDimsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def SqueezeOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/StridedSliceOptions.py b/tools/tflitefile_tool/tflite/StridedSliceOptions.py
new file mode 100644 (file)
index 0000000..3bbb36b
--- /dev/null
@@ -0,0 +1,62 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class StridedSliceOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsStridedSliceOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = StridedSliceOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # StridedSliceOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # StridedSliceOptions
+    def BeginMask(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
+
+    # StridedSliceOptions
+    def EndMask(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+    # StridedSliceOptions
+    def EllipsisMask(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
+
+    # StridedSliceOptions
+    def NewAxisMask(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
+
+    # StridedSliceOptions
+    def ShrinkAxisMask(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
+        return 0
+
+def StridedSliceOptionsStart(builder): builder.StartObject(5)
+def StridedSliceOptionsAddBeginMask(builder, beginMask): builder.PrependInt32Slot(0, beginMask, 0)
+def StridedSliceOptionsAddEndMask(builder, endMask): builder.PrependInt32Slot(1, endMask, 0)
+def StridedSliceOptionsAddEllipsisMask(builder, ellipsisMask): builder.PrependInt32Slot(2, ellipsisMask, 0)
+def StridedSliceOptionsAddNewAxisMask(builder, newAxisMask): builder.PrependInt32Slot(3, newAxisMask, 0)
+def StridedSliceOptionsAddShrinkAxisMask(builder, shrinkAxisMask): builder.PrependInt32Slot(4, shrinkAxisMask, 0)
+def StridedSliceOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SubGraph.py b/tools/tflitefile_tool/tflite/SubGraph.py
new file mode 100644 (file)
index 0000000..0c04cb3
--- /dev/null
@@ -0,0 +1,122 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SubGraph(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSubGraph(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SubGraph()
+        x.Init(buf, n + offset)
+        return x
+
+    # SubGraph
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SubGraph
+    def Tensors(self, j):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            x = self._tab.Vector(o)
+            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
+            x = self._tab.Indirect(x)
+            from .Tensor import Tensor
+            obj = Tensor()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+    # SubGraph
+    def TensorsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # SubGraph
+    def Inputs(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
+
+    # SubGraph
+    def InputsAsNumpy(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
+
+    # SubGraph
+    def InputsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # SubGraph
+    def Outputs(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
+
+    # SubGraph
+    def OutputsAsNumpy(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
+
+    # SubGraph
+    def OutputsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # SubGraph
+    def Operators(self, j):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            x = self._tab.Vector(o)
+            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
+            x = self._tab.Indirect(x)
+            from .Operator import Operator
+            obj = Operator()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+    # SubGraph
+    def OperatorsLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # SubGraph
+    def Name(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            return self._tab.String(o + self._tab.Pos)
+        return bytes()
+
+def SubGraphStart(builder): builder.StartObject(5)
+def SubGraphAddTensors(builder, tensors): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(tensors), 0)
+def SubGraphStartTensorsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def SubGraphAddInputs(builder, inputs): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(inputs), 0)
+def SubGraphStartInputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def SubGraphAddOutputs(builder, outputs): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(outputs), 0)
+def SubGraphStartOutputsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def SubGraphAddOperators(builder, operators): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(operators), 0)
+def SubGraphStartOperatorsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def SubGraphAddName(builder, name): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
+def SubGraphEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/SubOptions.py b/tools/tflitefile_tool/tflite/SubOptions.py
new file mode 100644 (file)
index 0000000..eccd7ab
--- /dev/null
@@ -0,0 +1,30 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class SubOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsSubOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = SubOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # SubOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # SubOptions
+    def FusedActivationFunction(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 SubOptionsStart(builder): builder.StartObject(1)
+def SubOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(0, fusedActivationFunction, 0)
+def SubOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/Tensor.py b/tools/tflitefile_tool/tflite/Tensor.py
new file mode 100644 (file)
index 0000000..f913e78
--- /dev/null
@@ -0,0 +1,82 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class Tensor(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsTensor(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = Tensor()
+        x.Init(buf, n + offset)
+        return x
+
+    # Tensor
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+    # Tensor
+    def Shape(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
+
+    # Tensor
+    def ShapeAsNumpy(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
+
+    # Tensor
+    def ShapeLength(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
+        if o != 0:
+            return self._tab.VectorLen(o)
+        return 0
+
+    # Tensor
+    def Type(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
+
+    # Tensor
+    def Buffer(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
+        if o != 0:
+            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
+        return 0
+
+    # Tensor
+    def Name(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
+        if o != 0:
+            return self._tab.String(o + self._tab.Pos)
+        return bytes()
+
+    # Tensor
+    def Quantization(self):
+        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
+        if o != 0:
+            x = self._tab.Indirect(o + self._tab.Pos)
+            from .QuantizationParameters import QuantizationParameters
+            obj = QuantizationParameters()
+            obj.Init(self._tab.Bytes, x)
+            return obj
+        return None
+
+def TensorStart(builder): builder.StartObject(5)
+def TensorAddShape(builder, shape): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(shape), 0)
+def TensorStartShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4)
+def TensorAddType(builder, type): builder.PrependInt8Slot(1, type, 0)
+def TensorAddBuffer(builder, buffer): builder.PrependUint32Slot(2, buffer, 0)
+def TensorAddName(builder, name): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
+def TensorAddQuantization(builder, quantization): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(quantization), 0)
+def TensorEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/TensorType.py b/tools/tflitefile_tool/tflite/TensorType.py
new file mode 100644 (file)
index 0000000..ef1ecfe
--- /dev/null
@@ -0,0 +1,12 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+class TensorType(object):
+    FLOAT32 = 0
+    FLOAT16 = 1
+    INT32 = 2
+    UINT8 = 3
+    INT64 = 4
+    STRING = 5
+
diff --git a/tools/tflitefile_tool/tflite/TopKV2Options.py b/tools/tflitefile_tool/tflite/TopKV2Options.py
new file mode 100644 (file)
index 0000000..ccd5103
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class TopKV2Options(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsTopKV2Options(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = TopKV2Options()
+        x.Init(buf, n + offset)
+        return x
+
+    # TopKV2Options
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def TopKV2OptionsStart(builder): builder.StartObject(0)
+def TopKV2OptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/TransposeOptions.py b/tools/tflitefile_tool/tflite/TransposeOptions.py
new file mode 100644 (file)
index 0000000..42c596d
--- /dev/null
@@ -0,0 +1,22 @@
+# automatically generated by the FlatBuffers compiler, do not modify
+
+# namespace: tflite
+
+import flatbuffers
+
+class TransposeOptions(object):
+    __slots__ = ['_tab']
+
+    @classmethod
+    def GetRootAsTransposeOptions(cls, buf, offset):
+        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
+        x = TransposeOptions()
+        x.Init(buf, n + offset)
+        return x
+
+    # TransposeOptions
+    def Init(self, buf, pos):
+        self._tab = flatbuffers.table.Table(buf, pos)
+
+def TransposeOptionsStart(builder): builder.StartObject(0)
+def TransposeOptionsEnd(builder): return builder.EndObject()
diff --git a/tools/tflitefile_tool/tflite/__init__.py b/tools/tflitefile_tool/tflite/__init__.py
new file mode 100644 (file)
index 0000000..e69de29