(args, iteration, optimizer)
| 204 | |
| 205 | |
| 206 | def save_zero_checkpoint(args, iteration, optimizer): |
| 207 | zero_sd = { |
| 208 | 'iteration': iteration, |
| 209 | 'optimizer_state_dict': optimizer.state_dict() |
| 210 | } |
| 211 | zero_checkpoint_name = get_checkpoint_name(args.save, iteration, zero=True) |
| 212 | ensure_directory_exists(zero_checkpoint_name) |
| 213 | torch.save(zero_sd, zero_checkpoint_name) |
| 214 | print(' successfully saved {}'.format(zero_checkpoint_name)) |
| 215 | |
| 216 | |
| 217 | def save_checkpoint(iteration, |
nothing calls this directly
no test coverage detected
searching dependent graphs…