Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame^] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | # Copyright (c) 2020, ARM Limited. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | |
| 18 | # namespace: tosa |
| 19 | |
| 20 | import flatbuffers |
| 21 | |
| 22 | class TransposeConv2dAttribute(object): |
| 23 | __slots__ = ['_tab'] |
| 24 | |
| 25 | @classmethod |
| 26 | def GetRootAsTransposeConv2dAttribute(cls, buf, offset): |
| 27 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 28 | x = TransposeConv2dAttribute() |
| 29 | x.Init(buf, n + offset) |
| 30 | return x |
| 31 | |
| 32 | # TransposeConv2dAttribute |
| 33 | def Init(self, buf, pos): |
| 34 | self._tab = flatbuffers.table.Table(buf, pos) |
| 35 | |
| 36 | # TransposeConv2dAttribute |
| 37 | def Outpad(self, j): |
| 38 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 39 | if o != 0: |
| 40 | a = self._tab.Vector(o) |
| 41 | return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) |
| 42 | return 0 |
| 43 | |
| 44 | # TransposeConv2dAttribute |
| 45 | def OutpadAsNumpy(self): |
| 46 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 47 | if o != 0: |
| 48 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) |
| 49 | return 0 |
| 50 | |
| 51 | # TransposeConv2dAttribute |
| 52 | def OutpadLength(self): |
| 53 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 54 | if o != 0: |
| 55 | return self._tab.VectorLen(o) |
| 56 | return 0 |
| 57 | |
| 58 | # TransposeConv2dAttribute |
| 59 | def Stride(self, j): |
| 60 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 61 | if o != 0: |
| 62 | a = self._tab.Vector(o) |
| 63 | return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) |
| 64 | return 0 |
| 65 | |
| 66 | # TransposeConv2dAttribute |
| 67 | def StrideAsNumpy(self): |
| 68 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 69 | if o != 0: |
| 70 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) |
| 71 | return 0 |
| 72 | |
| 73 | # TransposeConv2dAttribute |
| 74 | def StrideLength(self): |
| 75 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 76 | if o != 0: |
| 77 | return self._tab.VectorLen(o) |
| 78 | return 0 |
| 79 | |
| 80 | # TransposeConv2dAttribute |
| 81 | def Dilation(self, j): |
| 82 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 83 | if o != 0: |
| 84 | a = self._tab.Vector(o) |
| 85 | return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) |
| 86 | return 0 |
| 87 | |
| 88 | # TransposeConv2dAttribute |
| 89 | def DilationAsNumpy(self): |
| 90 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 91 | if o != 0: |
| 92 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) |
| 93 | return 0 |
| 94 | |
| 95 | # TransposeConv2dAttribute |
| 96 | def DilationLength(self): |
| 97 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 98 | if o != 0: |
| 99 | return self._tab.VectorLen(o) |
| 100 | return 0 |
| 101 | |
| 102 | # TransposeConv2dAttribute |
| 103 | def OutputShape(self, j): |
| 104 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 105 | if o != 0: |
| 106 | a = self._tab.Vector(o) |
| 107 | return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) |
| 108 | return 0 |
| 109 | |
| 110 | # TransposeConv2dAttribute |
| 111 | def OutputShapeAsNumpy(self): |
| 112 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 113 | if o != 0: |
| 114 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int32Flags, o) |
| 115 | return 0 |
| 116 | |
| 117 | # TransposeConv2dAttribute |
| 118 | def OutputShapeLength(self): |
| 119 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) |
| 120 | if o != 0: |
| 121 | return self._tab.VectorLen(o) |
| 122 | return 0 |
| 123 | |
| 124 | def TransposeConv2dAttributeStart(builder): builder.StartObject(4) |
| 125 | def TransposeConv2dAttributeAddOutpad(builder, outpad): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(outpad), 0) |
| 126 | def TransposeConv2dAttributeStartOutpadVector(builder, numElems): return builder.StartVector(4, numElems, 4) |
| 127 | def TransposeConv2dAttributeAddStride(builder, stride): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(stride), 0) |
| 128 | def TransposeConv2dAttributeStartStrideVector(builder, numElems): return builder.StartVector(4, numElems, 4) |
| 129 | def TransposeConv2dAttributeAddDilation(builder, dilation): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(dilation), 0) |
| 130 | def TransposeConv2dAttributeStartDilationVector(builder, numElems): return builder.StartVector(4, numElems, 4) |
| 131 | def TransposeConv2dAttributeAddOutputShape(builder, outputShape): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(outputShape), 0) |
| 132 | def TransposeConv2dAttributeStartOutputShapeVector(builder, numElems): return builder.StartVector(4, numElems, 4) |
| 133 | def TransposeConv2dAttributeEnd(builder): return builder.EndObject() |