Rob Elliott | 00a15db | 2023-08-17 14:27:06 +0000 | [diff] [blame^] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | # namespace: tosa |
| 4 | |
| 5 | import flatbuffers |
| 6 | from flatbuffers.compat import import_numpy |
| 7 | np = import_numpy() |
| 8 | |
| 9 | class CustomAttribute(object): |
| 10 | __slots__ = ['_tab'] |
| 11 | |
| 12 | @classmethod |
| 13 | def GetRootAs(cls, buf, offset=0): |
| 14 | n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) |
| 15 | x = CustomAttribute() |
| 16 | x.Init(buf, n + offset) |
| 17 | return x |
| 18 | |
| 19 | @classmethod |
| 20 | def GetRootAsCustomAttribute(cls, buf, offset=0): |
| 21 | """This method is deprecated. Please switch to GetRootAs.""" |
| 22 | return cls.GetRootAs(buf, offset) |
| 23 | @classmethod |
| 24 | def CustomAttributeBufferHasIdentifier(cls, buf, offset, size_prefixed=False): |
| 25 | return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x4F\x53\x41", size_prefixed=size_prefixed) |
| 26 | |
| 27 | # CustomAttribute |
| 28 | def Init(self, buf, pos): |
| 29 | self._tab = flatbuffers.table.Table(buf, pos) |
| 30 | |
| 31 | # CustomAttribute |
| 32 | def Identifier(self): |
| 33 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) |
| 34 | if o != 0: |
| 35 | return self._tab.String(o + self._tab.Pos) |
| 36 | return None |
| 37 | |
| 38 | # CustomAttribute |
| 39 | def Config(self): |
| 40 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) |
| 41 | if o != 0: |
| 42 | return self._tab.String(o + self._tab.Pos) |
| 43 | return None |
| 44 | |
| 45 | # CustomAttribute |
| 46 | def ImplementationAttrs(self, j): |
| 47 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 48 | if o != 0: |
| 49 | a = self._tab.Vector(o) |
| 50 | return self._tab.Get(flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)) |
| 51 | return 0 |
| 52 | |
| 53 | # CustomAttribute |
| 54 | def ImplementationAttrsAsNumpy(self): |
| 55 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 56 | if o != 0: |
| 57 | return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o) |
| 58 | return 0 |
| 59 | |
| 60 | # CustomAttribute |
| 61 | def ImplementationAttrsLength(self): |
| 62 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 63 | if o != 0: |
| 64 | return self._tab.VectorLen(o) |
| 65 | return 0 |
| 66 | |
| 67 | # CustomAttribute |
| 68 | def ImplementationAttrsIsNone(self): |
| 69 | o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) |
| 70 | return o == 0 |
| 71 | |
| 72 | def CustomAttributeStart(builder): |
| 73 | builder.StartObject(3) |
| 74 | |
| 75 | def Start(builder): |
| 76 | CustomAttributeStart(builder) |
| 77 | |
| 78 | def CustomAttributeAddIdentifier(builder, identifier): |
| 79 | builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(identifier), 0) |
| 80 | |
| 81 | def AddIdentifier(builder, identifier): |
| 82 | CustomAttributeAddIdentifier(builder, identifier) |
| 83 | |
| 84 | def CustomAttributeAddConfig(builder, config): |
| 85 | builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(config), 0) |
| 86 | |
| 87 | def AddConfig(builder, config): |
| 88 | CustomAttributeAddConfig(builder, config) |
| 89 | |
| 90 | def CustomAttributeAddImplementationAttrs(builder, implementationAttrs): |
| 91 | builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(implementationAttrs), 0) |
| 92 | |
| 93 | def AddImplementationAttrs(builder, implementationAttrs): |
| 94 | CustomAttributeAddImplementationAttrs(builder, implementationAttrs) |
| 95 | |
| 96 | def CustomAttributeStartImplementationAttrsVector(builder, numElems): |
| 97 | return builder.StartVector(1, numElems, 1) |
| 98 | |
| 99 | def StartImplementationAttrsVector(builder, numElems: int) -> int: |
| 100 | return CustomAttributeStartImplementationAttrsVector(builder, numElems) |
| 101 | |
| 102 | def CustomAttributeEnd(builder): |
| 103 | return builder.EndObject() |
| 104 | |
| 105 | def End(builder): |
| 106 | return CustomAttributeEnd(builder) |