Added dummy input for one-shot size-checking

This commit is contained in:
Zhengyi Chen 2024-02-29 18:44:42 +00:00
parent dcc3f57596
commit ab633da4a5
4 changed files with 21 additions and 7 deletions

8
checkpoint.py Normal file
View 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")