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
fe365d58
Commit
fe365d58
authored
Jan 28, 2019
by
Natalia Gimelshein
Browse files
don't convert to float bn with affine=False
parent
c8bc3e62
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 @
fe365d58
...
...
@@ -27,7 +27,7 @@ def BN_convert_float(module):
fn to all modules, parameters, and buffers. Thus we wouldn't
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
()
for
child
in
module
.
children
():
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