One solution may be storing all arguments.
def save(..):
    save_checkpoint({
                'kargs'      : kargs,
                'epoch'      : epoch,
                'state_dict' : model.state_dict(),
                'optimizer'  : optimizer.state_dict()
    }, filename=filename)

kargs = {...}
model = MyModel(**kargs)
##--------------------##
ckpt = torch.load(args.resume)
model = MyModel(**ckpt[kargs])