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/12/16 05:35:12 UTC

[GitHub] [tvm] lightzhan-intellif commented on a diff in pull request #13630: [BugFix][TVMScript] Parser crash

lightzhan-intellif commented on code in PR #13630:
URL: https://github.com/apache/tvm/pull/13630#discussion_r1050386527


##########
tests/python/unittest/test_tvmscript_regression.py:
##########
@@ -45,5 +45,20 @@ def test_multi_element_array_in_outmost_namespace():
     tvm.ir.assert_structural_equal(func, rt_func)
 
 
+def test_different_dtype_assignment_to_var():
+    @T.prim_func
+    def test_case():
+        a = T.alloc_buffer((10, 10), dtype="int8")
+
+    @T.prim_func
+    def func_ref():
+        a = T.alloc_buffer([10, 10], dtype="int8")
+        T.evaluate(0)
+
+    tvm.ir.assert_structural_equal(test_case, func_ref)
+
+
 if __name__ == "__main__":
+    a = numpy.zeros((10, 10), dtype="int8")

Review Comment:
   I am very sorry that it can not in this case. If we do so, prim function can not capture the var 'a' because it is not a nonlocal variable of func test_case.



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