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

Optimize use of Unsqueeze to add a single dimension to a tensor #257

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

robertknight
Copy link
Owner

Optimize this common use of Unsqueeze:

  • Use TensorBase::insert_axis to more efficiently insert new axes into the output

  • Add fast path when axes vector has only one item, in which case we can skip testing the axes for uniqueness

 - Use `TensorBase::insert_axis` to more efficiently insert new axes
   into the output

 - Add fast path when `axes` vector has only one item, in which case we
   can skip testing the axes for uniqueness
@robertknight robertknight merged commit 01929cd into main Jun 29, 2024
2 checks passed
@robertknight robertknight deleted the optimize-unsqueeze branch June 29, 2024 11:32
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