Fixed group of syncbn (#427)

pull/432/head
Jerry Jiarui XU 2020-07-17 11:16:47 +08:00 committed by GitHub
parent 4a044c6466
commit 07e4215286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,8 @@ class SyncBatchNorm(Module):
self.momentum = momentum
self.affine = affine
self.track_running_stats = track_running_stats
self.group = dist.group.WORLD if group is None else group
group = dist.group.WORLD if group is None else group
self.group = group
self.group_size = dist.get_world_size(group)
if self.affine:
self.weight = Parameter(torch.Tensor(num_features))