[1/N] Add strict parameter to Python zip calls (#165531)

Add `strict=True/False` to zip calls in test utils. `strict=True` is passed when possible.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165531
Approved by: https://github.com/Skylion007
This commit is contained in:
Yuanyuan Chen
2025-10-18 05:26:29 +00:00
committed by PyTorch MergeBot
parent 0f0b4bf029
commit aaac8cb0f5
24 changed files with 111 additions and 74 deletions

View File

@ -1153,7 +1153,7 @@ def run_subtests(
subtest_config_values: list[list[Any]] = [item[1] for item in subtest_config_items]
for values in itertools.product(*subtest_config_values):
# Map keyword to chosen value
subtest_kwargs = dict(zip(subtest_config_keys, values))
subtest_kwargs = dict(zip(subtest_config_keys, values, strict=True))
with cls_inst.subTest(**subtest_kwargs):
torch._dynamo.reset()
test_fn(*test_args, **test_kwargs, **subtest_kwargs)