MCPcopy Create free account
hub / github.com/PrathamLearnsToCode/paper2code / apply

Method apply

skills/paper2code/worked/ddpm/src/utils.py:233–237  ·  view source on GitHub ↗

Load EMA weights into model (for evaluation/sampling).

(self, model: nn.Module)

Source from the content-addressed store, hash-verified

231 )
232
233 def apply(self, model: nn.Module):
234 """Load EMA weights into model (for evaluation/sampling)."""
235 for name, param in model.named_parameters():
236 if name in self.shadow:
237 param.data.copy_(self.shadow[name])
238
239 def restore(self, model: nn.Module):
240 """Restore original model weights (after evaluation)."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected