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
apex
Commits
0b848f0d
Unverified
Commit
0b848f0d
authored
Jan 28, 2019
by
mcarilli
Committed by
GitHub
Jan 28, 2019
Browse files
Merge pull request #137 from ngimel/bn_convert
don't convert to float bn with affine=False
parents
8b9ce244
fe365d58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
apex/fp16_utils/fp16util.py
apex/fp16_utils/fp16util.py
+1
-1
No files found.
apex/fp16_utils/fp16util.py
View file @
0b848f0d
...
@@ -27,7 +27,7 @@ def BN_convert_float(module):
...
@@ -27,7 +27,7 @@ def BN_convert_float(module):
fn to all modules, parameters, and buffers. Thus we wouldn't
fn to all modules, parameters, and buffers. Thus we wouldn't
be able to guard the float conversion based on the module type.
be able to guard the float conversion based on the module type.
'''
'''
if
isinstance
(
module
,
torch
.
nn
.
modules
.
batchnorm
.
_BatchNorm
):
if
isinstance
(
module
,
torch
.
nn
.
modules
.
batchnorm
.
_BatchNorm
)
and
module
.
affine
is
True
:
module
.
float
()
module
.
float
()
for
child
in
module
.
children
():
for
child
in
module
.
children
():
BN_convert_float
(
child
)
BN_convert_float
(
child
)
...
...
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