shingjan opened a new pull request, #10892:
URL: https://github.com/apache/tvm/pull/10892

   This is a temporary fix for python not handling this case 
`T.Buffer[(T.int64(xx), T.int64(xx)), "float32"]` well. For now, 
`TVMScriptPrinter` will not print `match_buffer` with syntax sugar if the 
`shape` argument is typed other than `int32`.
   
   Root cause of this behavior is that we defined `T.Buffer` as 
`__getitem__(self, args)` in which `args` is a list of all arguments. But 
adding `T.int64` to the list will make Python think there is more than one 
positional arguments and raise a TypeError. TVMScript with such semantics could 
actually pass our parser check but not the type checker of Python, meaning only 
handwritten script with typed args in  `T.buffer` will raise this error.
   
   @MasterJH5574 @vinx13 @junrushao1994 


-- 
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