#[non_exhaustive]pub enum FerrayError {
ShapeMismatch {
message: String,
},
BroadcastFailure {
shape_a: Vec<usize>,
shape_b: Vec<usize>,
},
AxisOutOfBounds {
axis: usize,
ndim: usize,
},
IndexOutOfBounds {
index: isize,
axis: usize,
size: usize,
},
SingularMatrix {
message: String,
},
ConvergenceFailure {
iterations: usize,
message: String,
},
InvalidDtype {
message: String,
},
NumericalInstability {
message: String,
},
IoError {
message: String,
},
InvalidValue {
message: String,
},
}Expand description
The primary error type for all ferray operations.
This enum is #[non_exhaustive], so new variants may be added
in minor releases without breaking downstream code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ShapeMismatch
Operand shapes are incompatible for the requested operation.
BroadcastFailure
Broadcasting failed because shapes cannot be reconciled.
AxisOutOfBounds
An axis index exceeded the array’s dimensionality.
IndexOutOfBounds
An element index exceeded the array’s extent along some axis.
Fields
SingularMatrix
A matrix was singular when an invertible one was required.
ConvergenceFailure
An iterative algorithm did not converge within its budget.
InvalidDtype
The requested dtype is invalid or unsupported for this operation.
NumericalInstability
A computation produced NaN / Inf when finite results were required.
IoError
An I/O operation failed.
InvalidValue
A function argument was invalid.
Implementations§
Source§impl FerrayError
impl FerrayError
Sourcepub fn shape_mismatch(msg: impl Display) -> Self
pub fn shape_mismatch(msg: impl Display) -> Self
Create a ShapeMismatch error with a formatted message.
Sourcepub fn broadcast_failure(a: &[usize], b: &[usize]) -> Self
pub fn broadcast_failure(a: &[usize], b: &[usize]) -> Self
Create a BroadcastFailure error.
Sourcepub fn axis_out_of_bounds(axis: usize, ndim: usize) -> Self
pub fn axis_out_of_bounds(axis: usize, ndim: usize) -> Self
Create an AxisOutOfBounds error.
Sourcepub fn index_out_of_bounds(index: isize, axis: usize, size: usize) -> Self
pub fn index_out_of_bounds(index: isize, axis: usize, size: usize) -> Self
Create an IndexOutOfBounds error.
Sourcepub fn invalid_dtype(msg: impl Display) -> Self
pub fn invalid_dtype(msg: impl Display) -> Self
Create an InvalidDtype error with a formatted message.
Sourcepub fn invalid_value(msg: impl Display) -> Self
pub fn invalid_value(msg: impl Display) -> Self
Create an InvalidValue error with a formatted message.
Trait Implementations§
Source§impl Clone for FerrayError
impl Clone for FerrayError
Source§fn clone(&self) -> FerrayError
fn clone(&self) -> FerrayError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more