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 2023/01/16 04:02:54 UTC

[GitHub] [tvm] Hzfengsy commented on a diff in pull request #13788: [TIR][Fix] Buffer slicing using index dtype as extent

Hzfengsy commented on code in PR #13788:
URL: https://github.com/apache/tvm/pull/13788#discussion_r1070814965


##########
tests/python/unittest/test_tvmscript_regression.py:
##########
@@ -73,9 +74,17 @@ def func_ref():
     tvm.ir.assert_structural_equal(test_case, func_ref)
 
 
+def test_tir_buffer_region_extent_correct_dtype():
+    @T.prim_func
+    def func(A: T.Buffer[(T.int64(16), T.int64(1)), "float32"]):
+        for i in T.grid(T.int64(16)):
+            with T.block("block"):
+                vi = T.axis.remap("S", [i])
+                T.reads(A[vi, T.int64(0) : T.int64(1)])
+                T.evaluate(0)
+
+    assert func.body.block.body.body.block.reads[0].region[0].extent.dtype == "int64"
+
+
 if __name__ == "__main__":
-    a = numpy.zeros((10, 10), dtype="int8")
-    test_multi_element_array_in_outmost_namespace()
-    test_different_dtype_assignment_to_var()
-    b = 1
-    test_var_capturing_order()
+    tvm.testing.main()

Review Comment:
   `a = numpy.zeros((10, 10), dtype="int8")` here is to test var capturing in https://github.com/apache/tvm/pull/13640. I appreciate it if you could revert it and add a comment here. 



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