Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unknown exit() from utils.py #264

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BlackHC
Copy link

@BlackHC BlackHC commented Dec 5, 2024

No description provided.

@wiseodd
Copy link
Collaborator

wiseodd commented Dec 6, 2024

Thanks a lot, @BlackHC! LGTM, but could you add a test for this here? https://github.com/aleximmer/Laplace/blob/main/tests/test_utils.py

Copy link
Owner

@aleximmer aleximmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I don't think this necessarily requires a test. A more verbose exception is easy to do though so I would add that.

@@ -219,7 +219,7 @@ def symeig(M: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
stats = f"diag: {M.diagonal()}, max: {M.abs().max()}, "
stats = stats + f"min: {M.abs().min()}, mean: {M.abs().mean()}"
logging.info(f"SYMEIG: adding jitter failed. Stats: {stats}")
exit()
raise
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for replacing this silent exit. Could you make it verbose with raise RuntimeError(f"Adding jitter failed. Stats: {stats}") from e?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants