Lunderberg commented on code in PR #15577: URL: https://github.com/apache/tvm/pull/15577#discussion_r1313927771
########## tests/python/relax/test_bind_symbolic_vars.py: ########## @@ -183,6 +183,91 @@ def expected(A: R.Tensor(["M", 16])): tvm.ir.assert_structural_equal(expected, after) +def test_bind_symbolic_vars_in_shape_expr(): + """The bound variable should be replaced when appearing in R.Shape""" + + @R.function(private=True) + def before(A: R.Tensor(["M * N"]), x: R.Shape(["M", "N"])): Review Comment: I was thinking so, mainly because it would be the same support that is provided in TIR. (`ArgBinder::BindDLTensor` defines the symbolic variables prior to asserting based on the shapes.) There's also a couple of edge cases that I think would be easier to handle by allowing it. Swapping the order of commutative operators, hoisting `R.match_cast` from the body into the function signature, and handling cases with mutually-dependent shapes. (e.g. The first parameter is `R.Tensor(["a * b", "b"])` and the second parameter is `R.Tensor(["a * b", "a"])`.) -- 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-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org