[inductor] don't append None to choices (#161672)

Summary: don't append None as a choice to choices in autotune

Test Plan: See internal Diff

Differential Revision: D81188644

Pull Request resolved: https://github.com/pytorch/pytorch/pull/161672
Approved by: https://github.com/angelayi
This commit is contained in:
Shangdi Yu
2025-08-28 18:48:50 +00:00
committed by PyTorch MergeBot
parent 049c08eda8
commit 30ab87c884

View File

@ -1453,7 +1453,9 @@ class TritonTemplate(KernelTemplate):
"""
try:
choices.append(self.generate(generate_with_caching=True, **kwargs))
choice = self.generate(generate_with_caching=True, **kwargs)
if choice is not None:
choices.append(choice)
return None
except NotImplementedError as e:
log.info(