mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[BE] remove duplicates in generated torch._VF.__all__
(#157365)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/157365 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
c78fce9e79
commit
b146e1a264
@ -1737,10 +1737,10 @@ def gen_pyi(
|
||||
|
||||
# Include only the functions that contain hints, to prevent undefined
|
||||
# symbols to be included in the `__all__` directive.
|
||||
hinted_function_names = [
|
||||
hinted_function_names = {
|
||||
name for name, hint in unsorted_function_hints.items() if hint
|
||||
]
|
||||
all_symbols = sorted(list(structseqs) + hinted_function_names)
|
||||
}
|
||||
all_symbols = sorted(hinted_function_names.union(structseqs))
|
||||
all_directive = [
|
||||
"__all__ = [",
|
||||
*(f' "{name}",' for name in all_symbols),
|
||||
|
Reference in New Issue
Block a user