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 fallible variants of TensorBase::slice_with #365

Merged
merged 5 commits into from
Sep 19, 2024
Merged

Conversation

robertknight
Copy link
Owner

Add fallible variants of the new slice_with method and use it to replace usage of the old try_slice_* methods in rten operators.

In the process the errors reported by fallible slicing methods have been improved to include more details about the problem.

These are now breaking changes since existing low-level layout methods exported by rten-tensor have been modified and so has SliceError.

The `TensorBase` type has both panicking and result-returning variants of
slicing methods. To make it possible to implement both of these on top of a
uniform low-level API, change the low-level APIs to all return results.
Add details about which axis was affected and the index/range that was out of
bounds.
Use the new slice method that will provied a unified fallible way to slice a
tensor and get back either a static or dynamic-rank view.
Promise that the `Layout` associated type is a `MutLayout`, so we don't have to
add that bound everywhere that uses it.
@robertknight robertknight marked this pull request as ready for review September 19, 2024 21:37
@robertknight robertknight merged commit aecc370 into main Sep 19, 2024
2 checks passed
@robertknight robertknight deleted the try-slice-with branch September 19, 2024 21:38
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