pub enum SliceError {
TooManyDims {
ndim: usize,
range_ndim: usize,
},
InvalidAxis {
axis: usize,
},
InvalidIndex {
axis: usize,
index: isize,
size: usize,
},
InvalidRange {
axis: usize,
range: SliceRange,
size: usize,
},
InvalidStep {
axis: usize,
step: isize,
},
OutputDimsMismatch {
actual: usize,
expected: usize,
},
}
Expand description
Errors that can occur when slicing a tensor.
Variants§
TooManyDims
The slice spec has more dimensions than the tensor being sliced.
Fields
InvalidAxis
The slice spec specified an axis that is equal to or greater than the dimension count.
InvalidIndex
An index in the slice spec is out of bounds for the corresponding tensor dimension.
Fields
InvalidRange
A range in the slice spec is out of bounds for the corresponding tensor dimension.
Fields
§
range: SliceRange
The range item.
InvalidStep
The step in a slice range is negative, in a context where this is not supported.
OutputDimsMismatch
There is a mismatch between the actual and expected number of axes in the output slice.
Trait Implementations§
Source§impl Clone for SliceError
impl Clone for SliceError
Source§fn clone(&self) -> SliceError
fn clone(&self) -> SliceError
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 SliceError
impl Debug for SliceError
Source§impl Display for SliceError
impl Display for SliceError
Source§impl Error for SliceError
impl Error for SliceError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for SliceError
impl PartialEq for SliceError
impl StructuralPartialEq for SliceError
Auto Trait Implementations§
impl Freeze for SliceError
impl RefUnwindSafe for SliceError
impl Send for SliceError
impl Sync for SliceError
impl Unpin for SliceError
impl UnwindSafe for SliceError
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