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

Fix log_sum_exp to handle large positive/negative inputs #2367

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Fix log_sum_exp to handle large positive/negative inputs #2367

merged 1 commit into from
Aug 1, 2024

Conversation

yunjhongwu
Copy link
Contributor

Fixing #2356

For the updated unit test case, the current log_sum_exp(-1) yields [[3.4076, 6.4076], [-inf, inf]]. With this fix, the result will be [[3.4076, 6.4076], [-998.5924, 1001.4076]], which matches the output from pytorch.

@LaurentMazare
Copy link
Collaborator

Nice, thanks!

@LaurentMazare LaurentMazare merged commit bd80078 into huggingface:main Aug 1, 2024
10 checks passed
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.

2 participants