From c6af0f43fa5c0d47a672aee61d60d262556b63ca 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: Tue, 10 Jul 2018 18:53:55 +0900 Subject: [PATCH] Update tflite file API (#1832) Update tflite file API generated by flatc Using updated schema in tensorflow 1.9 Signed-off-by: Hyeongseok Oh --- tools/tflitefile_tool/tflite/ArgMaxOptions.py | 39 ++++++++++++++ tools/tflitefile_tool/tflite/BuiltinOperator.py | 16 ++++++ tools/tflitefile_tool/tflite/BuiltinOptions.py | 12 +++++ tools/tflitefile_tool/tflite/CastOptions.py | 24 ++++++++- tools/tflitefile_tool/tflite/Conv2DOptions.py | 24 ++++++++- .../tflitefile_tool/tflite/GreaterEqualOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/GreaterOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/LessEqualOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/LessOptions.py | 28 ++++++++++ .../tflite/MaximumMinimumOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/Model.py | 35 ++++++++++++- tools/tflitefile_tool/tflite/NegOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/OperatorCode.py | 13 ++++- tools/tflitefile_tool/tflite/PadV2Options.py | 28 ++++++++++ tools/tflitefile_tool/tflite/SelectOptions.py | 28 ++++++++++ tools/tflitefile_tool/tflite/SliceOptions.py | 28 ++++++++++ .../tflitefile_tool/tflite/SparseToDenseOptions.py | 39 ++++++++++++++ tools/tflitefile_tool/tflite/TensorType.py | 1 + .../tflitefile_tool/tflite/TransposeConvOptions.py | 61 ++++++++++++++++++++++ 19 files changed, 512 insertions(+), 4 deletions(-) create mode 100644 tools/tflitefile_tool/tflite/ArgMaxOptions.py create mode 100644 tools/tflitefile_tool/tflite/GreaterEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/GreaterOptions.py create mode 100644 tools/tflitefile_tool/tflite/LessEqualOptions.py create mode 100644 tools/tflitefile_tool/tflite/LessOptions.py create mode 100644 tools/tflitefile_tool/tflite/MaximumMinimumOptions.py create mode 100644 tools/tflitefile_tool/tflite/NegOptions.py create mode 100644 tools/tflitefile_tool/tflite/PadV2Options.py create mode 100644 tools/tflitefile_tool/tflite/SelectOptions.py create mode 100644 tools/tflitefile_tool/tflite/SliceOptions.py create mode 100644 tools/tflitefile_tool/tflite/SparseToDenseOptions.py create mode 100644 tools/tflitefile_tool/tflite/TransposeConvOptions.py diff --git a/tools/tflitefile_tool/tflite/ArgMaxOptions.py b/tools/tflitefile_tool/tflite/ArgMaxOptions.py new file mode 100644 index 0000000..23cbfd7 --- /dev/null +++ b/tools/tflitefile_tool/tflite/ArgMaxOptions.py @@ -0,0 +1,39 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class ArgMaxOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsArgMaxOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = ArgMaxOptions() + x.Init(buf, n + offset) + return x + + # ArgMaxOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # ArgMaxOptions + 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 ArgMaxOptionsStart(builder): + builder.StartObject(1) + + +def ArgMaxOptionsAddOutputType(builder, outputType): + builder.PrependInt8Slot(0, outputType, 0) + + +def ArgMaxOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/BuiltinOperator.py b/tools/tflitefile_tool/tflite/BuiltinOperator.py index 5ab8d9f..a629001 100644 --- a/tools/tflitefile_tool/tflite/BuiltinOperator.py +++ b/tools/tflitefile_tool/tflite/BuiltinOperator.py @@ -11,6 +11,7 @@ class BuiltinOperator(object): DEPTHWISE_CONV_2D = 4 DEQUANTIZE = 6 EMBEDDING_LOOKUP = 7 + FLOOR = 8 FULLY_CONNECTED = 9 HASHTABLE_LOOKUP = 10 L2_NORMALIZATION = 11 @@ -56,3 +57,18 @@ class BuiltinOperator(object): DELEGATE = 51 BIDIRECTIONAL_SEQUENCE_LSTM = 52 CAST = 53 + PRELU = 54 + MAXIMUM = 55 + ARG_MAX = 56 + MINIMUM = 57 + LESS = 58 + NEG = 59 + PADV2 = 60 + GREATER = 61 + GREATER_EQUAL = 62 + LESS_EQUAL = 63 + SELECT = 64 + SLICE = 65 + SIN = 66 + TRANSPOSE_CONV = 67 + SPARSE_TO_DENSE = 68 diff --git a/tools/tflitefile_tool/tflite/BuiltinOptions.py b/tools/tflitefile_tool/tflite/BuiltinOptions.py index 3883217..b979d89 100644 --- a/tools/tflitefile_tool/tflite/BuiltinOptions.py +++ b/tools/tflitefile_tool/tflite/BuiltinOptions.py @@ -43,3 +43,15 @@ class BuiltinOptions(object): LogSoftmaxOptions = 36 CastOptions = 37 DequantizeOptions = 38 + MaximumMinimumOptions = 39 + ArgMaxOptions = 40 + LessOptions = 41 + NegOptions = 42 + PadV2Options = 43 + GreaterOptions = 44 + GreaterEqualOptions = 45 + LessEqualOptions = 46 + SelectOptions = 47 + SliceOptions = 48 + TransposeConvOptions = 49 + SparseToDenseOptions = 50 diff --git a/tools/tflitefile_tool/tflite/CastOptions.py b/tools/tflitefile_tool/tflite/CastOptions.py index 13e76bb..7f7a1dd 100644 --- a/tools/tflitefile_tool/tflite/CastOptions.py +++ b/tools/tflitefile_tool/tflite/CastOptions.py @@ -19,9 +19,31 @@ class CastOptions(object): def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) + # CastOptions + def InDataType(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 + + # CastOptions + def OutDataType(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 CastOptionsStart(builder): - builder.StartObject(0) + builder.StartObject(2) + + +def CastOptionsAddInDataType(builder, inDataType): + builder.PrependInt8Slot(0, inDataType, 0) + + +def CastOptionsAddOutDataType(builder, outDataType): + builder.PrependInt8Slot(1, outDataType, 0) def CastOptionsEnd(builder): diff --git a/tools/tflitefile_tool/tflite/Conv2DOptions.py b/tools/tflitefile_tool/tflite/Conv2DOptions.py index e204a76..9137295 100644 --- a/tools/tflitefile_tool/tflite/Conv2DOptions.py +++ b/tools/tflitefile_tool/tflite/Conv2DOptions.py @@ -47,9 +47,23 @@ class Conv2DOptions(object): return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) return 0 + # Conv2DOptions + def DilationWFactor(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 1 + + # Conv2DOptions + def DilationHFactor(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 1 + def Conv2DOptionsStart(builder): - builder.StartObject(4) + builder.StartObject(6) def Conv2DOptionsAddPadding(builder, padding): @@ -68,5 +82,13 @@ def Conv2DOptionsAddFusedActivationFunction(builder, fusedActivationFunction): builder.PrependInt8Slot(3, fusedActivationFunction, 0) +def Conv2DOptionsAddDilationWFactor(builder, dilationWFactor): + builder.PrependInt32Slot(4, dilationWFactor, 1) + + +def Conv2DOptionsAddDilationHFactor(builder, dilationHFactor): + builder.PrependInt32Slot(5, dilationHFactor, 1) + + def Conv2DOptionsEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/GreaterEqualOptions.py b/tools/tflitefile_tool/tflite/GreaterEqualOptions.py new file mode 100644 index 0000000..12df3c8 --- /dev/null +++ b/tools/tflitefile_tool/tflite/GreaterEqualOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class GreaterEqualOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsGreaterEqualOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = GreaterEqualOptions() + x.Init(buf, n + offset) + return x + + # GreaterEqualOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def GreaterEqualOptionsStart(builder): + builder.StartObject(0) + + +def GreaterEqualOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/GreaterOptions.py b/tools/tflitefile_tool/tflite/GreaterOptions.py new file mode 100644 index 0000000..614cdb2 --- /dev/null +++ b/tools/tflitefile_tool/tflite/GreaterOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class GreaterOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsGreaterOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = GreaterOptions() + x.Init(buf, n + offset) + return x + + # GreaterOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def GreaterOptionsStart(builder): + builder.StartObject(0) + + +def GreaterOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/LessEqualOptions.py b/tools/tflitefile_tool/tflite/LessEqualOptions.py new file mode 100644 index 0000000..ef93bcc --- /dev/null +++ b/tools/tflitefile_tool/tflite/LessEqualOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class LessEqualOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLessEqualOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LessEqualOptions() + x.Init(buf, n + offset) + return x + + # LessEqualOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def LessEqualOptionsStart(builder): + builder.StartObject(0) + + +def LessEqualOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/LessOptions.py b/tools/tflitefile_tool/tflite/LessOptions.py new file mode 100644 index 0000000..a94b37f --- /dev/null +++ b/tools/tflitefile_tool/tflite/LessOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class LessOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsLessOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = LessOptions() + x.Init(buf, n + offset) + return x + + # LessOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def LessOptionsStart(builder): + builder.StartObject(0) + + +def LessOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/MaximumMinimumOptions.py b/tools/tflitefile_tool/tflite/MaximumMinimumOptions.py new file mode 100644 index 0000000..c99494b --- /dev/null +++ b/tools/tflitefile_tool/tflite/MaximumMinimumOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class MaximumMinimumOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsMaximumMinimumOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = MaximumMinimumOptions() + x.Init(buf, n + offset) + return x + + # MaximumMinimumOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def MaximumMinimumOptionsStart(builder): + builder.StartObject(0) + + +def MaximumMinimumOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/Model.py b/tools/tflitefile_tool/tflite/Model.py index dda9afa..af53629 100644 --- a/tools/tflitefile_tool/tflite/Model.py +++ b/tools/tflitefile_tool/tflite/Model.py @@ -93,9 +93,33 @@ class Model(object): return self._tab.VectorLen(o) return 0 + # Model + def MetadataBuffer(self, j): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + a = self._tab.Vector(o) + return self._tab.Get( + flatbuffers.number_types.Int32Flags, + a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) + return 0 + + # Model + def MetadataBufferAsNumpy(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) + return 0 + + # Model + def MetadataBufferLength(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) + if o != 0: + return self._tab.VectorLen(o) + return 0 + def ModelStart(builder): - builder.StartObject(5) + builder.StartObject(6) def ModelAddVersion(builder, version): @@ -134,5 +158,14 @@ def ModelStartBuffersVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def ModelAddMetadataBuffer(builder, metadataBuffer): + builder.PrependUOffsetTRelativeSlot( + 5, flatbuffers.number_types.UOffsetTFlags.py_type(metadataBuffer), 0) + + +def ModelStartMetadataBufferVector(builder, numElems): + return builder.StartVector(4, numElems, 4) + + def ModelEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/NegOptions.py b/tools/tflitefile_tool/tflite/NegOptions.py new file mode 100644 index 0000000..f3d98e7 --- /dev/null +++ b/tools/tflitefile_tool/tflite/NegOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class NegOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsNegOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = NegOptions() + x.Init(buf, n + offset) + return x + + # NegOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def NegOptionsStart(builder): + builder.StartObject(0) + + +def NegOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/OperatorCode.py b/tools/tflitefile_tool/tflite/OperatorCode.py index a9bbf3c..f4b09b6 100644 --- a/tools/tflitefile_tool/tflite/OperatorCode.py +++ b/tools/tflitefile_tool/tflite/OperatorCode.py @@ -33,9 +33,16 @@ class OperatorCode(object): return self._tab.String(o + self._tab.Pos) return bytes() + # OperatorCode + def Version(self): + o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) + if o != 0: + return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) + return 1 + def OperatorCodeStart(builder): - builder.StartObject(2) + builder.StartObject(3) def OperatorCodeAddBuiltinCode(builder, builtinCode): @@ -47,5 +54,9 @@ def OperatorCodeAddCustomCode(builder, customCode): 1, flatbuffers.number_types.UOffsetTFlags.py_type(customCode), 0) +def OperatorCodeAddVersion(builder, version): + builder.PrependInt32Slot(2, version, 1) + + def OperatorCodeEnd(builder): return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/PadV2Options.py b/tools/tflitefile_tool/tflite/PadV2Options.py new file mode 100644 index 0000000..bddea9d --- /dev/null +++ b/tools/tflitefile_tool/tflite/PadV2Options.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class PadV2Options(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsPadV2Options(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = PadV2Options() + x.Init(buf, n + offset) + return x + + # PadV2Options + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def PadV2OptionsStart(builder): + builder.StartObject(0) + + +def PadV2OptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/SelectOptions.py b/tools/tflitefile_tool/tflite/SelectOptions.py new file mode 100644 index 0000000..5539a87 --- /dev/null +++ b/tools/tflitefile_tool/tflite/SelectOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class SelectOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSelectOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = SelectOptions() + x.Init(buf, n + offset) + return x + + # SelectOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def SelectOptionsStart(builder): + builder.StartObject(0) + + +def SelectOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/SliceOptions.py b/tools/tflitefile_tool/tflite/SliceOptions.py new file mode 100644 index 0000000..2cce3a0 --- /dev/null +++ b/tools/tflitefile_tool/tflite/SliceOptions.py @@ -0,0 +1,28 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class SliceOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSliceOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = SliceOptions() + x.Init(buf, n + offset) + return x + + # SliceOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + +def SliceOptionsStart(builder): + builder.StartObject(0) + + +def SliceOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/SparseToDenseOptions.py b/tools/tflitefile_tool/tflite/SparseToDenseOptions.py new file mode 100644 index 0000000..2782ae5 --- /dev/null +++ b/tools/tflitefile_tool/tflite/SparseToDenseOptions.py @@ -0,0 +1,39 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class SparseToDenseOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsSparseToDenseOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = SparseToDenseOptions() + x.Init(buf, n + offset) + return x + + # SparseToDenseOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # SparseToDenseOptions + def ValidateIndices(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 SparseToDenseOptionsStart(builder): + builder.StartObject(1) + + +def SparseToDenseOptionsAddValidateIndices(builder, validateIndices): + builder.PrependBoolSlot(0, validateIndices, 0) + + +def SparseToDenseOptionsEnd(builder): + return builder.EndObject() diff --git a/tools/tflitefile_tool/tflite/TensorType.py b/tools/tflitefile_tool/tflite/TensorType.py index e0490d0..e0f1542 100644 --- a/tools/tflitefile_tool/tflite/TensorType.py +++ b/tools/tflitefile_tool/tflite/TensorType.py @@ -10,3 +10,4 @@ class TensorType(object): UINT8 = 3 INT64 = 4 STRING = 5 + BOOL = 6 diff --git a/tools/tflitefile_tool/tflite/TransposeConvOptions.py b/tools/tflitefile_tool/tflite/TransposeConvOptions.py new file mode 100644 index 0000000..d36a843 --- /dev/null +++ b/tools/tflitefile_tool/tflite/TransposeConvOptions.py @@ -0,0 +1,61 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: tflite + +import flatbuffers + + +class TransposeConvOptions(object): + __slots__ = ['_tab'] + + @classmethod + def GetRootAsTransposeConvOptions(cls, buf, offset): + n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) + x = TransposeConvOptions() + x.Init(buf, n + offset) + return x + + # TransposeConvOptions + def Init(self, buf, pos): + self._tab = flatbuffers.table.Table(buf, pos) + + # TransposeConvOptions + 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 + + # TransposeConvOptions + 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 + + # TransposeConvOptions + 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 + + +def TransposeConvOptionsStart(builder): + builder.StartObject(3) + + +def TransposeConvOptionsAddPadding(builder, padding): + builder.PrependInt8Slot(0, padding, 0) + + +def TransposeConvOptionsAddStrideW(builder, strideW): + builder.PrependInt32Slot(1, strideW, 0) + + +def TransposeConvOptionsAddStrideH(builder, strideH): + builder.PrependInt32Slot(2, strideH, 0) + + +def TransposeConvOptionsEnd(builder): + return builder.EndObject() -- 2.7.4