def METHOD_NAME(ckpt_path, model, device=None):
    if not Path(ckpt_path).is_file():
        raise ValueError("checkpoint {} not exist.".format(ckpt_path))
    model.load_state_dict(torch.load(ckpt_path, map_location=device))
    print("Restoring parameters from {}".format(ckpt_path))