You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/03/26 07:03:47 UTC

[GitHub] [tvm] MasterJH5574 commented on pull request #10789: [TVMScript] Parser `int64` support

MasterJH5574 commented on pull request #10789:
URL: https://github.com/apache/tvm/pull/10789#issuecomment-1079625981


   Hi @shingjan, I noted that our TVMScript parser fails when `T.int64` appears in the parameter type annotation.
   
   For example, when parsing the following script,
   ```python
   @T.prim_func
   def elementwise_shape_int64(
       A: T.Buffer[(T.int64(128), T.int64(128)), "float32"],
       C: T.Buffer[(T.int64(128), T.int64(128)), "float32"],
   ) -> None:
       B = T.alloc_buffer((T.int64(128), T.int64(128)), dtype="float32")
       for i, j in T.grid(128, 128):
           with T.block("B"):
               vi, vj = T.axis.remap("SS", [i, j])
               B[vi, vj] = A[vi, vj] * 2.0
       for i, j in T.grid(T.int64(128), T.int64(128)):
           with T.block("C"):
               vi, vj = T.axis.remap("SS", [i, j])
               C[vi, vj] = B[vi, vj] + 1.0
   ```
   the parser fails with message
   ```
   Traceback (most recent call last):
     File "tensorir.py", line 32, in Fused
       A: T.Buffer[(T.int64(128), T.int64(128)), "float32"],
   TypeError: __call__() takes 1 positional argument but 2 were given
   ```
   
   Could you help take a look into this case? If the parser cannot support `int64` in type annotation, we shouldn't print the buffer in sugar-style in the printer. Thanks a lot!!


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org