Added dummy input for one-shot size-checking
This commit is contained in:
parent
dcc3f57596
commit
ab633da4a5
4 changed files with 21 additions and 7 deletions
8
checkpoint.py
Normal file
8
checkpoint.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import torch
|
||||
import shutil
|
||||
|
||||
def save_checkpoint(state, is_best: bool, task_id, fname="checkpoint.pth.tar"):
|
||||
fdir = "./"+str(task_id)+"/"
|
||||
torch.save(state, fdir + fname)
|
||||
if is_best:
|
||||
shutil.copyfile(fdir + fname, fdir + "best.pth.tar")
|
||||
Loading…
Add table
Add a link
Reference in a new issue