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

Add stack as a callback #1482

Merged
merged 2 commits into from May 13, 2024
Merged

Add stack as a callback #1482

merged 2 commits into from May 13, 2024

Conversation

josevalim
Copy link
Collaborator

Generally speaking we want to reduce the number of callbacks but stack causes one additional copy of every tensor and it is used very frequently.

One option is to use optional callbacks, but concatenate/stack are the only operations that require a variable number of arguments, which is hard to include as part of the optional/evaluator system, so it its own callback.

Closes #1441.

Generally speaking we want to reduce the number of callbacks
but stack causes one additional copy of every tensor and it
is used very frequently.

One option is to use optional callbacks, but concatenate/stack
are the only operations that require a variable number of arguments,
which is hard to include as part of the optional/evaluator system,
so it its own callback.
@josevalim josevalim merged commit e5c82f8 into main May 13, 2024
7 of 8 checks passed
@josevalim josevalim deleted the jv-stack branch May 13, 2024 11:24
@josevalim
Copy link
Collaborator Author

💚 💙 💜 💛 ❤️

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.

Implement Nx.stack as a default callback
1 participant