gemini-code-assist[bot] commented on code in PR #19803:
URL: https://github.com/apache/tvm/pull/19803#discussion_r3424782113
##########
tests/python/s_tir/base/test_tir_te_extern_primfunc.py:
##########
@@ -172,19 +172,22 @@ def verify_func_4(module):
tvm.testing.assert_allclose(a_np + 1, f.numpy(), rtol=1e-4)
-class TestPrimFuncs:
- func, params, verify = tvm.testing.parameters(
- [func_1, ("A"), verify_func_1],
- [func_2, ("C", "D"), verify_func_2],
- [func_3, ("C", "A", "D", "E"), verify_func_3],
- [func_4, ("C", "A", "D", "E"), verify_func_4],
- )
+_primfunc_cases = [
+ [func_1, ("A"), verify_func_1],
Review Comment:

In Python, `("A")` is evaluated as a simple string `"A"` rather than a
1-tuple. Since `params` is expected to be an iterable of parameter names
(strings), passing a plain string will cause the test to iterate over its
individual characters (e.g., `'A'`). While this happens to work for a
single-character name like `"A"`, it is extremely fragile and will fail with a
`KeyError` if the parameter name is changed to a multi-character string (e.g.,
`"A_buf"`).\n\nPlease change `("A")` to a proper 1-tuple `("A",)` or a list
`["A"]` to ensure it is treated as a sequence of strings.
```suggestion
[func_1, ("A",), verify_func_1],
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]