Lunderberg commented on code in PR #16232:
URL: https://github.com/apache/tvm/pull/16232#discussion_r1425777229
##########
tests/python/relax/test_transform_legalize_ops_index_linear_algebra.py:
##########
@@ -210,6 +210,38 @@ def strided_slice(var_rxplaceholder: T.handle,
var_T_strided_slice_with_axes: T.
tvm.ir.assert_structural_equal(mod, Expected)
+def test_strided_slice_symbolic_bound():
+ # fmt: off
+ @tvm.script.ir_module
+ class StridedSlice:
+ @R.function
+ def main(x: R.Tensor((10, "n"), "float32")) -> R.Tensor((3, "n"),
"float32"):
+ n = T.int64(is_size_var=True)
+ gv: R.Tensor((3, n), "float32") = R.strided_slice(x, axes=[0, 1],
begin=[1, 0], end=[8, n], strides=[3, 1])
Review Comment:
It took me a moment to catch that this one test was validating both the
symbolic bound, as the second dimension of the output shape is `ceildiv(n-0, 1)
= n`, and the bugfix, as the first dimension of the output shape is
`ceildiv(8-1, 3) = 3`. Could we have these two behaviors be explicitly tested
in separate unit tests?
--
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]