pub struct SliceRange {
pub start: usize,
pub stop: usize,
pub step: usize,
}Expand description
A range specification for one axis when slicing a tensor.
Mirrors Python’s start:stop:step slice notation.
§Examples
let r = SliceRange::new(0, 10, 2); // 0, 2, 4, 6, 8
assert_eq!(r.start, 0);
assert_eq!(r.step, 2);Fields§
§start: usize§stop: usize§step: usizeImplementations§
Trait Implementations§
Source§impl Clone for SliceRange
impl Clone for SliceRange
Source§fn clone(&self) -> SliceRange
fn clone(&self) -> SliceRange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SliceRange
impl Debug for SliceRange
impl Copy for SliceRange
Auto Trait Implementations§
impl Freeze for SliceRange
impl RefUnwindSafe for SliceRange
impl Send for SliceRange
impl Sync for SliceRange
impl Unpin for SliceRange
impl UnsafeUnpin for SliceRange
impl UnwindSafe for SliceRange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more