vinx13 commented on a change in pull request #9492:
URL: https://github.com/apache/tvm/pull/9492#discussion_r764391434



##########
File path: python/tvm/script/parser.py
##########
@@ -276,6 +280,22 @@ def parse_arg_list(self, func, node_call):
         reader = CallArgumentReader(func_name, args, kw_args, self, node_call)
         pos_only, kwargs, varargs = param_list
         internal_args = list()
+        # check the default value of "name" for TypeCall and TypeApply
+        # if none, change it to the variable name
+        # Note that here the variable name will always be the last
+        # item in self.context.func_params. See transform_Function
+        # for more details of adding function parameters in self.context
+        # buf_name: str = self.context.func_params[-1].name
+        # if isinstance(node_call, ast.TypeApply):
+        #     if len(args) == 2:
+        #         args.append(buf_name)
+        #     elif len(args) == 1:
+        #         args.append("float32")  # default value for 'dtype'
+        #         args.append(buf_name)
+        # if isinstance(node_call, ast.TypeCall):
+        #     if "name" not in kw_args:
+        #         kw_args["name"] = buf_name
+

Review comment:
       remove this

##########
File path: python/tvm/script/parser.py
##########
@@ -1110,6 +1145,32 @@ def transform_TypeConstant(self, node):
         """
         return node.value
 
+    def transform_TypeTuple(self, node):
+        """Tuple value visitor for types.
+
+        Mostly used in `transform_TypeCall` and `transform_TypeApply`.
+        """
+        return [self.transform(value) for value in node.values]
+
+    def handle_match_buffer_type(self, node, buffer_name):
+        """special function to handle syntax sugar for match buffer.
+
+        This method is for syntax sugar of T.match_buffer()/[]
+        """
+        func = self.transform(node.func_name)
+
+        if isinstance(func, SpecialStmt):

Review comment:
       since this method is now specifically for match buffer, you can assert 
this and remove the error reporting below




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to