Skip to content

Conversation

RsqM
Copy link

@RsqM RsqM commented Feb 26, 2025

Adding 1e-8 after division slightly shifts all outputs away from zero but doesn’t prevent division errors if sum_exp_x is exactly zero. Instead, adding it before division ensures sum_exp_x is never zero, avoiding potential division errors and preventing extreme values like inf or NaN, especially in low-precision computations

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.

1 participant