Load EMA weights into model (for evaluation/sampling).
(self, model: nn.Module)
| 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).""" |
nothing calls this directly
no outgoing calls
no test coverage detected