MCPcopy
hub / github.com/lucidrains/byol-pytorch / MaybeSyncBatchnorm

Function MaybeSyncBatchnorm

byol_pytorch/byol_pytorch.py:41–43  ·  view source on GitHub ↗
(is_distributed = None)

Source from the content-addressed store, hash-verified

39 p.requires_grad = val
40
41def MaybeSyncBatchnorm(is_distributed = None):
42 is_distributed = default(is_distributed, dist.is_initialized() and dist.get_world_size() > 1)
43 return nn.SyncBatchNorm if is_distributed else nn.BatchNorm1d
44
45# loss fn
46

Callers 2

MLPFunction · 0.85
SimSiamMLPFunction · 0.85

Calls 1

defaultFunction · 0.85

Tested by

no test coverage detected