From 38d214cfa4491f1956f28d7eff428a8ed07d824c Mon Sep 17 00:00:00 2001 From: Kevin Cheng Date: Fri, 15 Oct 2021 15:49:19 -0700 Subject: 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 Change-Id: Ifcaa4ad686578cf814345ede8e7f37f0a04fd8ea --- python/tosa_serializer.py | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'python/tosa_serializer.py') 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""" -- cgit v1.2.1