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
78c38db4
"...text-generation-inference.git" did not exist on "042180d88f91d4bc9acd42ae4de3c0236d272de4"
Commit
78c38db4
authored
Aug 26, 2019
by
Du Xingjian
Committed by
mcarilli
Aug 25, 2019
Browse files
skip instancenorm in convert_syncbn_model (#438)
parent
880ab925
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
apex/parallel/__init__.py
apex/parallel/__init__.py
+2
-0
No files found.
apex/parallel/__init__.py
View file @
78c38db4
...
@@ -37,6 +37,8 @@ def convert_syncbn_model(module, process_group=None, channel_last=False):
...
@@ -37,6 +37,8 @@ def convert_syncbn_model(module, process_group=None, channel_last=False):
>>> sync_bn_model = apex.parallel.convert_syncbn_model(model)
>>> sync_bn_model = apex.parallel.convert_syncbn_model(model)
'''
'''
mod
=
module
mod
=
module
if
isinstance
(
module
,
torch
.
nn
.
modules
.
instancenorm
.
_InstanceNorm
):
return
module
if
isinstance
(
module
,
torch
.
nn
.
modules
.
batchnorm
.
_BatchNorm
):
if
isinstance
(
module
,
torch
.
nn
.
modules
.
batchnorm
.
_BatchNorm
):
mod
=
SyncBatchNorm
(
module
.
num_features
,
module
.
eps
,
module
.
momentum
,
module
.
affine
,
module
.
track_running_stats
,
process_group
,
channel_last
=
channel_last
)
mod
=
SyncBatchNorm
(
module
.
num_features
,
module
.
eps
,
module
.
momentum
,
module
.
affine
,
module
.
track_running_stats
,
process_group
,
channel_last
=
channel_last
)
mod
.
running_mean
=
module
.
running_mean
mod
.
running_mean
=
module
.
running_mean
...
...
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