Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
50f2ad21
Commit
50f2ad21
authored
Jul 12, 2022
by
Kai Wang (Victor Kai)
Committed by
Frank Lee
Jul 13, 2022
Browse files
[NFC] polish colossalai/engine/ophooks/utils.py code style (#1256)
parent
2dd4d556
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
colossalai/engine/ophooks/utils.py
colossalai/engine/ophooks/utils.py
+1
-1
No files found.
colossalai/engine/ophooks/utils.py
View file @
50f2ad21
...
@@ -93,7 +93,7 @@ def register_ophooks_recursively(module: torch.nn.Module,
...
@@ -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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment