Beya2019 commented on a change in pull request #8408:
URL: https://github.com/apache/tvm/pull/8408#discussion_r665989107



##########
File path: tests/python/unittest/test_tvmscript_ops.py
##########
@@ -103,5 +103,46 @@ def test_get_valid_counts_script_func():
     _check_get_valid_counts_with_numpy(f, (1, 2500, 6), 0.0, 0, 1)
 
 
[email protected]
+def ops_with_buffer_slice_indices(data: ty.handle, index: ty.handle) -> None:
+    data_buf = tir.match_buffer(data, (1, 5, 6), "float16")
+    index_buf = tir.match_buffer(index, (1,), "int32")
+    copy_buf = tir.alloc_buffer((1, 5), "float16")
+
+    with tir.block([1, 5], "init") as [vi, vj]:
+        copy_buf[vi, vj] = data_buf[vi, vj, index_buf[0]]

Review comment:
       Follow the suggestion of @Hzfengsy, I convert the BufferSlice to 
BufferLoad in node.py
   
   Meanwhile, add the 3 test cases listed above
   1. add `func_with_bufferslice_indices` and 
`func_with_recursive_bufferslice_indices` in test_tvmscript_complete.py
   2. add the fail test case error_bufferslice_index_type in 
test_tvmscript_error_report.py
   3. Given that BufferLoad only accepts elementwise access, add the fail case 
`error_index_with_stop` `error_bufferslice_index_with_stop` in 
test_tvmscript_error_report.py




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