pub enum TensorIndex {
Index(i64),
Range(Option<i64>, Option<i64>, Option<i64>),
All,
List(Vec<i64>),
Mask(Tensor<bool>),
Ellipsis,
NewAxis,
}Expand description
Index type for tensor indexing
Variants§
Index(i64)
Single index
Range(Option<i64>, Option<i64>, Option<i64>)
Range of indices
All
All indices (:)
List(Vec<i64>)
List of indices (fancy indexing)
Mask(Tensor<bool>)
Boolean mask
Ellipsis
Ellipsis (…) - represents multiple ‘:’ to fill remaining dimensions
NewAxis
Newaxis (None) - adds a dimension of size 1
Implementations§
Trait Implementations§
Source§impl Clone for TensorIndex
impl Clone for TensorIndex
Source§fn clone(&self) -> TensorIndex
fn clone(&self) -> TensorIndex
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 moreAuto Trait Implementations§
impl Freeze for TensorIndex
impl RefUnwindSafe for TensorIndex
impl Send for TensorIndex
impl Sync for TensorIndex
impl Unpin for TensorIndex
impl UnwindSafe for TensorIndex
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