[Fix] Fix error implementation of is_model_wrapper (#640)

* [Fix] Fix is_model_wrapper

* [Fix] Fix is_model_wrapper
This commit is contained in:
Mashiro 2022-10-28 15:16:56 +08:00 committed by GitHub
parent 0857f9fb40
commit 1bf5c0c12e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,5 +26,5 @@ def is_model_wrapper(model: nn.Module, registry: Registry = MODEL_WRAPPERS):
if not registry.children:
return False
for child in registry.children.values():
return is_model_wrapper(model, child)
return any(
is_model_wrapper(model, child) for child in registry.children.values())