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
ea7c2098
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "30220905c4319e46e114cf7dc8047d94eca226f7"
Commit
ea7c2098
authored
Aug 27, 2019
by
Michael Carilli
Browse files
Merge branch 'master' of
https://github.com/NVIDIA/apex
parents
427e82cd
78c38db4
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 @
ea7c2098
...
@@ -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