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

Re-implement Where operator fallback #213

Merged
merged 2 commits into from
May 27, 2024

Conversation

robertknight
Copy link
Owner

Re-implement the slow path in the Where operator to use a code pattern similar to that added for binary ops in #190.

This replaces the last usage of the TensorBase::broadcast_iter method, so that code has been removed from rten-tensor. Any code outside the rten crates needing to broadcast tensors should be migrated to TensorBase::broadcast.

Fixes #189

Re-implement the slow path in `Where` for inputs that are not compatible with
the "fast broadcast" path. The implementation follows the same pattern as for
the fallback in binary operators.
Usage of `broadcast_iter` has been replaced by faster code patterns in binary,
ternary and variadic operators implementations.

Code needing to broadcast for other reasons can use `TensorBase::broadcast`
instead.

Fixes #189
@robertknight robertknight merged commit 1518c8a into main May 27, 2024
2 checks passed
@robertknight robertknight deleted the reimplement-where-op-fallback branch May 27, 2024 07:49
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.

Replace all usage of TensorBase::broadcast_iter
1 participant