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

jax.nn.softmax: only use initial=-inf when necessary #21264

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

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented May 16, 2024

jax.nn.softmax: only use initial=-inf when necessary

The reason we need initial at all here is becuase when a user passes where or takes the softmax of an empty array, it is required. In other cases, the value does not affect the output, and may lead to unnecessary computation.

Partially addresses #20856.

@copybara-service copybara-service bot force-pushed the test_634465693 branch 4 times, most recently from 266ed8f to f6813e4 Compare May 16, 2024 19:23
The reason we need initial at all here is becuase when a user passes `where` or takes the softmax of an empty array, it is required. In other cases, the value does not affect the output, and may lead to unnecessary computation.

Partially addresses #20856.

PiperOrigin-RevId: 634465693
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.

None yet

1 participant