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
72bd7c69
"git@developer.sourcefind.cn:OpenDAS/colossalai.git" did not exist on "a799ca343b13665661a5e95f5ad1523457bef2e2"
Unverified
Commit
72bd7c69
authored
Jun 13, 2022
by
Frank Lee
Committed by
GitHub
Jun 13, 2022
Browse files
[amp] included dict for type casting of model output (#1102)
parent
5a9d8ef4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
colossalai/amp/naive_amp/naive_amp.py
colossalai/amp/naive_amp/naive_amp.py
+2
-0
No files found.
colossalai/amp/naive_amp/naive_amp.py
View file @
72bd7c69
...
...
@@ -149,4 +149,6 @@ class NaiveAMPModel(nn.Module):
out
=
self
.
_convert_to_fp32
(
out
)
elif
isinstance
(
out
,
(
tuple
,
list
)):
out
=
[
self
.
_convert_to_fp32
(
val
)
for
val
in
out
]
elif
isinstance
(
out
,
dict
):
out
=
{
key
:
self
.
_convert_to_fp32
(
val
)
for
key
,
val
in
out
.
items
()}
return
out
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