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
d0624f4f
Unverified
Commit
d0624f4f
authored
Jan 28, 2019
by
mcarilli
Committed by
GitHub
Jan 28, 2019
Browse files
Update two_gpu_unit_test.py
parent
c8d7c9f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/synced_batchnorm/two_gpu_unit_test.py
tests/synced_batchnorm/two_gpu_unit_test.py
+1
-1
No files found.
tests/synced_batchnorm/two_gpu_unit_test.py
View file @
d0624f4f
...
@@ -93,7 +93,7 @@ grad_bn = grad_output_t.clone().detach()
...
@@ -93,7 +93,7 @@ grad_bn = grad_output_t.clone().detach()
out_bn
=
bn
(
inp_bn
)
out_bn
=
bn
(
inp_bn
)
out_bn
.
backward
(
grad_bn
)
out_bn
.
backward
(
grad_bn
)
# compensating the averaging over processes done by DDP
# compensating the averaging over processes done by DDP
# in order to produce math
m
etically equivalent result
# in order to produce mathe
ma
tically equivalent result
for
param
in
bn
.
parameters
():
for
param
in
bn
.
parameters
():
param
.
grad
=
param
.
grad
/
args
.
world_size
param
.
grad
=
param
.
grad
/
args
.
world_size
bn_opt
=
optim
.
SGD
(
bn
.
parameters
(),
lr
=
1.0
)
bn_opt
=
optim
.
SGD
(
bn
.
parameters
(),
lr
=
1.0
)
...
...
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