MCPcopy Create free account
hub / github.com/Yasoz/DiffTraj / register

Method register

utils/EMA.py:11–16  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

9 self.shadow = {}
10
11 def register(self, module):
12 if isinstance(module, nn.DataParallel):
13 module = module.module
14 for name, param in module.named_parameters():
15 if param.requires_grad:
16 self.shadow[name] = param.data.clone()
17
18 def update(self, module):
19 if isinstance(module, nn.DataParallel):

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected