mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
ReReland Fix public binding check for modules with __all__
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76045 Approved by: https://github.com/samdow
This commit is contained in:
parent
8c37a056df
commit
d2517a43db
File diff suppressed because it is too large
Load Diff
|
|
@ -325,11 +325,11 @@ class TestPublicBindings(TestCase):
|
|||
if is_public != looks_public:
|
||||
add_to_failure_list_if_not_in_allow_dict(modname, elem, elem_module)
|
||||
|
||||
if hasattr(modname, '__all__'):
|
||||
if hasattr(mod, '__all__'):
|
||||
public_api = mod.__all__
|
||||
all_api = dir(modname)
|
||||
all_api = dir(mod)
|
||||
for elem in all_api:
|
||||
looks_public_or_not(elem, modname, is_public=elem in public_api)
|
||||
looks_public_or_not(elem, modname, mod, is_public=elem in public_api)
|
||||
|
||||
else:
|
||||
all_api = dir(mod)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user