mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01: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:
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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user