diff options
author | TatWai Chong <tatwai.chong@arm.com> | 2022-05-10 17:26:20 -0700 |
---|---|---|
committer | TatWai Chong <tatwai.chong@arm.com> | 2022-06-07 09:45:49 -0700 |
commit | 7be7165ca5168d768a08841658c805dd1bda49c7 (patch) | |
tree | 757c55dd628dd8e97f7426d822ef116ada791aae /python/serializer | |
parent | 4102773d83e236448130b43b1747621ace00160f (diff) | |
download | serialization_lib-7be7165ca5168d768a08841658c805dd1bda49c7.tar.gz |
Align the serialization schema with TOSA 0.24.0 specification
The operators are pool, conv, reshape, slice, transpose, and table.
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Change-Id: I425ab407e699159f75834f31ad2d48e206c71749
Diffstat (limited to 'python/serializer')
-rw-r--r-- | python/serializer/tosa_serializer.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py index 660619b..fec676e 100644 --- a/python/serializer/tosa_serializer.py +++ b/python/serializer/tosa_serializer.py @@ -137,23 +137,23 @@ class TosaSerializerAttribute(TosaSerializerUnion): def __init__(self): super().__init__() - def PoolAttribute(self, kernel, stride, padding): + def PoolAttribute(self, kernel, stride, pad): from tosa import PoolAttribute as a, Attribute self.utype = Attribute.Attribute().PoolAttribute self.optFcns = (a.Start, a.End) - self.intvecs.append((a.AddPadding, padding)) + self.intvecs.append((a.AddPad, pad)) self.intvecs.append((a.AddKernel, kernel)) self.intvecs.append((a.AddStride, stride)) - def ConvAttribute(self, padding, stride, dilation): + def ConvAttribute(self, pad, stride, dilation): from tosa import ConvAttribute as a, Attribute self.utype = Attribute.Attribute().ConvAttribute self.optFcns = (a.Start, a.End) - self.intvecs.append((a.AddPadding, padding)) + self.intvecs.append((a.AddPad, pad)) self.intvecs.append((a.AddStride, stride)) self.intvecs.append((a.AddDilation, dilation)) @@ -186,21 +186,21 @@ class TosaSerializerAttribute(TosaSerializerUnion): self.ints.append((a.AddAxis, axis)) - def ReshapeAttribute(self, shape): + def ReshapeAttribute(self, new_shape): from tosa import ReshapeAttribute as a, Attribute self.utype = Attribute.Attribute().ReshapeAttribute self.optFcns = (a.Start, a.End) - self.intvecs.append((a.AddShape, shape)) + self.intvecs.append((a.AddNewShape, new_shape)) - def SliceAttribute(self, begin, size): + def SliceAttribute(self, start, size): from tosa import SliceAttribute as a, Attribute self.utype = Attribute.Attribute().SliceAttribute self.optFcns = (a.Start, a.End) - self.intvecs.append((a.AddBegin, begin)) + self.intvecs.append((a.AddStart, start)) self.intvecs.append((a.AddSize, size)) def TileAttribute(self, multiples): @@ -292,13 +292,13 @@ class TosaSerializerAttribute(TosaSerializerUnion): self.strings.append((a.AddCondBranch, cond_branch)) self.strings.append((a.AddBodyBranch, body_branch)) - def TransposeAttribute(self, perm): + def TransposeAttribute(self, perms): from tosa import TransposeAttribute as a, Attribute self.utype = Attribute.Attribute().TransposeAttribute self.optFcns = (a.Start, a.End) - self.intvecs.append((a.AddPerm, perm)) + self.intvecs.append((a.AddPerms, perms)) def TableAttribute(self, table): from tosa import TableAttribute as a, Attribute |