Enable passing in custom names for addConst

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I22e73e2aa9fbd54610fed776da9fbd09a4adae25
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index a1109d8..8330c3e 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -667,12 +667,13 @@
 
         return tens
 
-    def addConst(self, shape, dtype, vals):
+    def addConst(self, shape, dtype, vals, name=None):
         if not self.currBasicBlock:
             raise Exception("addTensor called without valid basic block")
 
-        name = "const-{}".format(self.currInputIdx)
-        self.currInputIdx = self.currInputIdx + 1
+        if name is None:
+            name = "const-{}".format(self.currInputIdx)
+            self.currInputIdx = self.currInputIdx + 1
 
         if self.constMode == ConstMode.INPUTS:
             # Save const as input file
@@ -773,8 +774,8 @@
     def addPlaceholder(self, shape, dtype, vals):
         return self.currRegion.addPlaceholder(shape, dtype, vals)
 
-    def addConst(self, shape, dtype, vals):
-        return self.currRegion.addConst(shape, dtype, vals)
+    def addConst(self, shape, dtype, vals, name=None):
+        return self.currRegion.addConst(shape, dtype, vals, name)
 
     def addIntermediate(self, shape, dtype):
         return self.currRegion.addIntermediate(shape, dtype)