Get parameters from model, handling DDP wrapper.
(model)
| 138 | |
| 139 | |
| 140 | def get_model_parameters(model): |
| 141 | """Get parameters from model, handling DDP wrapper.""" |
| 142 | return ( |
| 143 | model.module.parameters() |
| 144 | if isinstance(model, torch.nn.parallel.DistributedDataParallel) |
| 145 | else model.parameters() |
| 146 | ) |
| 147 | |
| 148 | |
| 149 | def save_checkpoint(model, optimizer, global_step, config, is_main, data_config): |
nothing calls this directly
no outgoing calls
no test coverage detected