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

Update slice documentation #2024

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/burn-tensor/src/tensor/api/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,14 @@ where
/// # Behavior
///
/// - Supports partial and full slicing in any number of dimensions.
/// - Missing ranges are treated as full slices if D > D2.
/// - Handles negative indices by wrapping around from the end of the dimension.
/// - Clamps ranges to the tensor's dimensions if they exceed the bounds.
/// - For `Option<(i64, i64)>` ranges, `None` selects the full range of that dimension.
///
/// # Panics
///
/// - If the number of ranges provided doesn't match the tensor's dimensions.
/// - If the number of ranges provided exceeds the tensor's dimensions.
/// - If a range is descending (e.g., 2..1) or empty (e.g., 1..1).
///
/// # Examples
Expand Down
Loading