Unverified Commit d0624f4f authored by mcarilli's avatar mcarilli Committed by GitHub
Browse files

Update two_gpu_unit_test.py

parent c8d7c9f1
...@@ -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 mathmetically equivalent result # in order to produce mathematically 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment