mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-07-04 19:16:42 +00:00
[NFC] polish colossalai/engine/ophooks/utils.py code style (#1256)
This commit is contained in:
parent
2dd4d556fb
commit
50f2ad213f
@ -93,7 +93,7 @@ def register_ophooks_recursively(module: torch.nn.Module,
|
|||||||
assert isinstance(ophook_list, (list, tuple))
|
assert isinstance(ophook_list, (list, tuple))
|
||||||
assert len(ophook_list) > 0, 'expected at least 1 hook in the argument ophook_list but found 0'
|
assert len(ophook_list) > 0, 'expected at least 1 hook in the argument ophook_list but found 0'
|
||||||
for hook in ophook_list:
|
for hook in ophook_list:
|
||||||
assert (isinstance(hook, BaseOpHook))
|
assert (isinstance(hook, BaseOpHook))
|
||||||
|
|
||||||
# Add hooks for submodules
|
# Add hooks for submodules
|
||||||
for child_name, child in module.named_children():
|
for child_name, child in module.named_children():
|
||||||
|
Loading…
Reference in New Issue
Block a user