[torchgen] Fix an unused variable in api/python.py (#142337)

Extracted from https://github.com/pytorch/pytorch/pull/136359

Changes behavior, but the original code seems like it was an obvious oops.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/142337
Approved by: https://github.com/Skylion007
This commit is contained in:
Tom Ritchford
2024-12-08 16:44:25 +00:00
committed by PyTorch MergeBot
parent ef26f1c57e
commit 869665c44c

View File

@ -994,7 +994,7 @@ def return_type_str_pyi(t: Type) -> str:
if t.name == BaseTy.Device:
return "_device"
elif t.name == BaseTy.Dimname:
ret = "Optional[str]"
return "Optional[str]"
else:
return argument_type_str_pyi(t)