pub enum TensorError {
InvalidShape {
shape: Vec<usize>,
},
ShapeProductOverflow {
shape: Vec<usize>,
},
IndexSpaceOverflow {
shape: Vec<usize>,
},
ShapeMismatch {
lhs: Vec<usize>,
rhs: Vec<usize>,
},
RankMismatch {
shape: Vec<usize>,
index_rank: usize,
},
ExpectedRank {
operation: &'static str,
expected: usize,
actual: usize,
},
ScalarCast(ScalarCastError),
}Expand description
Error returned by fallible tensor operations.
Variants§
InvalidShape
Shape contains no axes or contains at least one zero-length axis.
ShapeProductOverflow
Shape product overflowed usize.
IndexSpaceOverflow
An axis or the total linear domain cannot be represented by isize.
ShapeMismatch
Two tensors were expected to have the same shape.
RankMismatch
An index has the wrong rank for the tensor shape.
ExpectedRank
An operation expected a particular tensor rank.
ScalarCast(ScalarCastError)
Scalar conversion failed while casting tensor elements.
Trait Implementations§
Source§impl Clone for TensorError
impl Clone for TensorError
Source§fn clone(&self) -> TensorError
fn clone(&self) -> TensorError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TensorError
impl Debug for TensorError
Source§impl Display for TensorError
impl Display for TensorError
impl Eq for TensorError
Source§impl Error for TensorError
impl Error for TensorError
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 From<ScalarCastError> for TensorError
impl From<ScalarCastError> for TensorError
Source§fn from(value: ScalarCastError) -> Self
fn from(value: ScalarCastError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TensorError
impl PartialEq for TensorError
impl StructuralPartialEq for TensorError
Auto Trait Implementations§
impl Freeze for TensorError
impl RefUnwindSafe for TensorError
impl Send for TensorError
impl Sync for TensorError
impl Unpin for TensorError
impl UnsafeUnpin for TensorError
impl UnwindSafe for TensorError
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