Beya2019 opened a new pull request #8235:
URL: https://github.com/apache/tvm/pull/8235


   Now the function parameters decorated by @tvm.script.tir only support int32 
and handle.
   If we have such a demand: func parameters need to be int8 float32 and 
float16, we can only  write this
   (if c is a float32 data)
   ```
   @tvm.script.tir
   def func(a: ty.handle, b: ty.handle) -> None:
       A = tir.match_buffer(b, (1, 5), "float32")
       B = tir.match_buffer(c, (1), "float32")
       with tir.block([1, 5], "init") as [vi, vj]:
           A[vi, vj] = B[0]
   ```
   Would it be better like this(Under the premise of defining ty.float32) 
   ```
   @tvm.script.tir
   def func(a: ty.handle b: ty.float32) -> None:
       A = tir.match_buffer(b, (1, 5), "float32")
       A[vi, vj] = b
   ```
   In the future, if we use script to define more operators like the 
iou_threshold non_max_suppression and on_value/off_value in one_hot, this will 
simplify our coding IMO.
   


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

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


Reply via email to