diff options
Diffstat (limited to 'python/tosa/TosaGraph.py')
-rw-r--r-- | python/tosa/TosaGraph.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/python/tosa/TosaGraph.py b/python/tosa/TosaGraph.py index eceffdb..164cef2 100644 --- a/python/tosa/TosaGraph.py +++ b/python/tosa/TosaGraph.py @@ -10,13 +10,17 @@ class TosaGraph(object): __slots__ = ['_tab'] @classmethod - def GetRootAsTosaGraph(cls, buf, offset): + def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = TosaGraph() x.Init(buf, n + offset) return x @classmethod + def GetRootAsTosaGraph(cls, buf, offset=0): + """This method is deprecated. Please switch to GetRootAs.""" + return cls.GetRootAs(buf, offset) + @classmethod def TosaGraphBufferHasIdentifier(cls, buf, offset, size_prefixed=False): return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x4F\x53\x41", size_prefixed=size_prefixed) @@ -61,7 +65,17 @@ class TosaGraph(object): return o == 0 def TosaGraphStart(builder): builder.StartObject(2) +def Start(builder): + return TosaGraphStart(builder) def TosaGraphAddVersion(builder, version): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(version), 0) +def AddVersion(builder, version): + return TosaGraphAddVersion(builder, version) def TosaGraphAddBlocks(builder, blocks): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(blocks), 0) +def AddBlocks(builder, blocks): + return TosaGraphAddBlocks(builder, blocks) def TosaGraphStartBlocksVector(builder, numElems): return builder.StartVector(4, numElems, 4) +def StartBlocksVector(builder, numElems): + return TosaGraphStartBlocksVector(builder, numElems) def TosaGraphEnd(builder): return builder.EndObject() +def End(builder): + return TosaGraphEnd(builder)
\ No newline at end of file |