Return the underlying module behind a DDP wrapper (or the model itself).
(model: nn.Module)
| 92 | |
| 93 | |
| 94 | def unwrap(model: nn.Module) -> nn.Module: |
| 95 | """Return the underlying module behind a DDP wrapper (or the model itself).""" |
| 96 | return model.module if hasattr(model, "module") else model |
| 97 | |
| 98 | |
| 99 | def make_frozen_copy(model: nn.Module, device: str | None = None) -> nn.Module: |
no outgoing calls
no test coverage detected