You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "junrushao (via GitHub)" <gi...@apache.org> on 2023/06/27 05:36:53 UTC

[GitHub] [tvm] junrushao commented on a diff in pull request #15163: [TIR] Fix RenewDef for symbolic input shapes

junrushao commented on code in PR #15163:
URL: https://github.com/apache/tvm/pull/15163#discussion_r1243164258


##########
tests/python/unittest/test_tir_renew_defs.py:
##########
@@ -169,5 +170,21 @@ def symbolic_func(a: T.handle, b: T.handle, n: T.int32):
     tvm.ir.assert_structural_equal(f1, f2)
 
 
+def test_buffer_map():
+    @T.prim_func
+    def main(a: T.handle, b: T.handle):
+        m = T.int64()
+        A = T.match_buffer(a, (m * 2,))
+        B = T.match_buffer(b, (m, 2))
+        for i, j in T.grid(m, 2):
+            with T.block("B"):
+                vi, vj = T.axis.remap("SS", [i, j])
+                B[vi, vj] = A[vi * 2 + vj]
+
+    f1 = main
+    f2 = tvm.tir.stmt_functor.renew_defs(main)
+    tvm.ir.assert_structural_equal(f1, f2)

Review Comment:
   sg



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