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 TileAttribute(object): |
| 23 | __slots__ = ['_tab'] |
| 24 | |
| 25 | @classmethod |
| 26 | def GetRootAsTileAttribute(cls, buf, offset): |
| 27 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 28 | x = TileAttribute() |
| 29 | x.Init(buf, n + offset) |
| 30 | return x |
| 31 | |
| 32 | # TileAttribute |
| 33 | def Init(self, buf, pos): |
| 34 | self._tab = flatbuffers.table.Table(buf, pos) |
| 35 | |
| 36 | # TileAttribute |
| 37 | def Multiples(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 | # TileAttribute |
| 45 | def MultiplesAsNumpy(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 | # TileAttribute |
| 52 | def MultiplesLength(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 | def TileAttributeStart(builder): builder.StartObject(1) |
| 59 | def TileAttributeAddMultiples(builder, multiples): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(multiples), 0) |
| 60 | def TileAttributeStartMultiplesVector(builder, numElems): return builder.StartVector(4, numElems, 4) |
| 61 | def TileAttributeEnd(builder): return builder.EndObject() |