gemini-code-assist[bot] commented on code in PR #18428:
URL: https://github.com/apache/tvm/pull/18428#discussion_r2508500341
##########
tests/python/relax/test_frontend_from_exported_program.py:
##########
@@ -2748,10 +2748,30 @@ def main(
return gv
example_args = (torch.randn(1, 3, 10, 10, dtype=torch.float32),)
- verify_model(PadModel(pad=[1, 1, 2, 2]), example_args, {},
expected_constant)
- verify_model(PadModel(pad=[1, 1, 2, 2], mode="reflect"), example_args, {},
expected_reflect)
- verify_model(PadModel(pad=[1, 1, 2, 2], mode="replicate"), example_args,
{}, expected_replicate)
- verify_model(PadModel(pad=[1, 1, 2, 2], mode="circular"), example_args,
{}, expected_circular)
+ verify_model(
+ PadModel(pad=[1, 1, 2, 2]), example_args, {}, expected_constant,
run_ep_decomposition=True
+ )
+ verify_model(
+ PadModel(pad=[1, 1, 2, 2], mode="reflect"),
+ example_args,
+ {},
+ expected_reflect,
+ run_ep_decomposition=True,
+ )
+ verify_model(
+ PadModel(pad=[1, 1, 2, 2], mode="replicate"),
+ example_args,
+ {},
+ expected_replicate,
+ run_ep_decomposition=True,
+ )
+ verify_model(
+ PadModel(pad=[1, 1, 2, 2], mode="circular"),
+ example_args,
+ {},
+ expected_circular,
+ run_ep_decomposition=True,
+ )
Review Comment:

The repeated calls to `verify_model` with only minor variations make the
code verbose and harder to maintain. Consider refactoring these calls into a
loop over a list of test cases. This would make the test more compact and
easier to extend with new cases in the future. This suggestion applies to other
tests in this file as well, such as `test_pixel_shuffle`, `test_einsum`, etc.
```python
verify_model(PadModel(pad=[1, 1, 2, 2]), example_args, {},
expected_constant, run_ep_decomposition=True)
verify_model(PadModel(pad=[1, 1, 2, 2], mode="reflect"), example_args,
{}, expected_reflect, run_ep_decomposition=True)
verify_model(PadModel(pad=[1, 1, 2, 2], mode="replicate"), example_args,
{}, expected_replicate, run_ep_decomposition=True)
verify_model(PadModel(pad=[1, 1, 2, 2], mode="circular"), example_args,
{}, expected_circular, run_ep_decomposition=True)
```
--
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]