pub enum SliceItem {
Index(isize),
Range(SliceRange),
}
Expand description
Specifies a subset of a dimension to include when slicing a tensor or view.
Can be constructed from an index or range using index_or_range.into()
.
Variants§
Index(isize)
Extract a specific index from a dimension.
The number of dimensions in the sliced view will be one minus the number of dimensions sliced with an index. If the index is negative, it counts back from the end of the dimension.
Range(SliceRange)
Include a subset of the range of the dimension.
Implementations§
Trait Implementations§
impl Copy for SliceItem
impl StructuralPartialEq for SliceItem
Auto Trait Implementations§
impl Freeze for SliceItem
impl RefUnwindSafe for SliceItem
impl Send for SliceItem
impl Sync for SliceItem
impl Unpin for SliceItem
impl UnwindSafe for SliceItem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more