MCPcopy Create free account
hub / github.com/POSTECH-CVLab/PyTorch-StudioGAN / save_model

Function save_model

src/utils/misc.py:394–400  ·  view source on GitHub ↗
(model, when, step, ckpt_dir, states)

Source from the content-addressed store, hash-verified

392
393
394def 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
403def save_model_c(states, mode, RUN):

Callers

nothing calls this directly

Calls 2

find_and_removeFunction · 0.85
saveMethod · 0.80

Tested by

no test coverage detected