#[non_exhaustive]pub enum CoreError {
DimensionMismatch {
expected: Vec<usize>,
got: Vec<usize>,
},
InvalidShape {
shape: Vec<usize>,
reason: &'static str,
},
AxisOutOfBounds {
axis: usize,
ndim: usize,
},
IndexOutOfBounds {
index: Vec<usize>,
shape: Vec<usize>,
},
SingularMatrix,
InvalidArgument {
reason: &'static str,
},
BroadcastError {
shape_a: Vec<usize>,
shape_b: Vec<usize>,
},
}Expand description
All errors returned by scivex-core.
§Examples
use scivex_core::error::CoreError;
let e = CoreError::SingularMatrix;
assert_eq!(format!("{e}"), "singular matrix");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DimensionMismatch
Operand shapes do not match the required layout.
InvalidShape
A shape or stride specification is invalid.
AxisOutOfBounds
An axis index is out of bounds for the tensor’s rank.
IndexOutOfBounds
A flat or multi-dimensional index is out of bounds.
SingularMatrix
Matrix is singular and cannot be inverted / decomposed.
InvalidArgument
The operation is not supported for the given input.
BroadcastError
Shapes cannot be broadcast together.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()
impl Eq for CoreError
impl StructuralPartialEq for CoreError
Auto Trait Implementations§
impl Freeze for CoreError
impl RefUnwindSafe for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl UnsafeUnpin for CoreError
impl UnwindSafe for CoreError
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