(model, when, step, ckpt_dir, states)
| 392 | |
| 393 | |
| 394 | def save_model(model, when, step, ckpt_dir, states): |
| 395 | model_tpl = "model={model}-{when}-weights-step={step}.pth" |
| 396 | model_ckpt_list = glob.glob(join(ckpt_dir, model_tpl.format(model=model, when=when, step="*"))) |
| 397 | if len(model_ckpt_list) > 0: |
| 398 | find_and_remove(model_ckpt_list[0]) |
| 399 | |
| 400 | torch.save(states, join(ckpt_dir, model_tpl.format(model=model, when=when, step=step))) |
| 401 | |
| 402 | |
| 403 | def save_model_c(states, mode, RUN): |
nothing calls this directly
no test coverage detected