aboutsummaryrefslogtreecommitdiff
path: root/python/tosa_serializer.py
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2021-10-15 15:49:19 -0700
committerKevin Cheng <kevin.cheng@arm.com>2021-10-27 10:43:44 -0700
commit38d214cfa4491f1956f28d7eff428a8ed07d824c (patch)
tree871d86c6bc442149159d021724c392a0b9256b51 /python/tosa_serializer.py
parente6563f52231c603b409638b22530d016757542c8 (diff)
downloadserialization_lib-38d214cfa4491f1956f28d7eff428a8ed07d824c.tar.gz
Changes for 0.23.0 release
- Remove RELUN op - Add pad_const to PAD op - Make padding as an attribute of PAD op - Make perm as an attribute of TRANSPOSE op - Make table as attribute in Table op - Fix typo in operator.def Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: Ifcaa4ad686578cf814345ede8e7f37f0a04fd8ea
Diffstat (limited to 'python/tosa_serializer.py')
-rw-r--r--python/tosa_serializer.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/python/tosa_serializer.py b/python/tosa_serializer.py
index d85494d..3d0019e 100644
--- a/python/tosa_serializer.py
+++ b/python/tosa_serializer.py
@@ -170,14 +170,15 @@ class TosaSerializerAttribute(TosaSerializerUnion):
self.intvecs.append((a.TransposeConvAttributeAddDilation, dilation))
self.intvecs.append((a.TransposeConvAttributeAddOutputShape, output_shape))
- def ReluNAttribute(self, maxint, maxfp):
- from tosa import ReluNAttribute as a, Attribute
+ def PadAttribute(self, padding, pad_const_int, pad_const_fp):
+ from tosa import PadAttribute as a, Attribute
- self.utype = Attribute.Attribute().ReluNAttribute
- self.optFcns = (a.ReluNAttributeStart, a.ReluNAttributeEnd)
+ self.utype = Attribute.Attribute().PadAttribute
+ self.optFcns = (a.PadAttributeStart, a.PadAttributeEnd)
- self.ints.append((a.ReluNAttributeAddMaxInt, maxint))
- self.ints.append((a.ReluNAttributeAddMaxFp, maxfp))
+ self.intvecs.append((a.PadAttributeAddPadding, padding))
+ self.ints.append((a.PadAttributeAddPadConstInt, pad_const_int))
+ self.floats.append((a.PadAttributeAddPadConstFp, pad_const_fp))
def AxisAttribute(self, axis):
from tosa import AxisAttribute as a, Attribute
@@ -275,14 +276,6 @@ class TosaSerializerAttribute(TosaSerializerUnion):
self.bools.append((a.ArithmeticRightShiftAttributeAddRound, round))
- def CustomAttribute(self, identifier):
- from tosa import CustomAttribute as a, Attribute
-
- self.utype = Attribute.Attribute().CustomAttribute
- self.optFcns = (a.CustomAttributeStart, a.CustomAttributeEnd)
-
- self.strings.append((a.CustomAttributeAddIdentifier, identifier))
-
def CondIfAttribute(self, then_branch, else_branch):
from tosa import CondIfAttribute as a, Attribute
@@ -301,6 +294,21 @@ class TosaSerializerAttribute(TosaSerializerUnion):
self.strings.append((a.WhileLoopAttributeAddCondBranch, cond_branch))
self.strings.append((a.WhileLoopAttributeAddBodyBranch, body_branch))
+ def TransposeAttribute(self, perm):
+ from tosa import TransposeAttribute as a, Attribute
+
+ self.utype = Attribute.Attribute().TransposeAttribute
+ self.optFcns = (a.TransposeAttributeStart, a.TransposeAttributeEnd)
+
+ self.intvecs.append((a.TransposeAttributeAddPerm, perm))
+
+ def TableAttribute(self, table):
+ from tosa import TableAttribute as a, Attribute
+
+ self.utype = Attribute.Attribute().TableAttribute
+ self.optFcns = (a.TableAttributeStart, a.TableAttributeEnd)
+
+ self.intvecs.append((a.TableAttributeAddTable, table))
class TosaSerializerQuantInfo(TosaSerializerUnion):
"""This class handles encapsulating all of the enumerated types for quantinfo types"""