pub enum KernelError {
DimensionMismatch {
operation: String,
expected: Vec<usize>,
actual: Vec<usize>,
context: String,
},
InvalidMode {
mode: usize,
max_mode: usize,
context: String,
},
RankMismatch {
operation: String,
expected_rank: usize,
actual_rank: usize,
factor_index: usize,
},
EmptyInput {
operation: String,
parameter: String,
},
InvalidTileSize {
operation: String,
tile_size: usize,
reason: String,
},
IncompatibleShapes {
operation: String,
shape_a: Vec<usize>,
shape_b: Vec<usize>,
reason: String,
},
OperationError {
operation: String,
message: String,
},
}Expand description
Error type for tensor kernel operations
Variants§
DimensionMismatch
Dimension mismatch between operands
InvalidMode
Invalid mode/axis specification
RankMismatch
Rank mismatch (e.g., different CP ranks in factor matrices)
EmptyInput
Empty input not allowed
InvalidTileSize
Invalid tile/block size
IncompatibleShapes
Shape incompatibility
OperationError
Generic operation error with context
Implementations§
Source§impl KernelError
impl KernelError
Sourcepub fn dimension_mismatch(
operation: impl Into<String>,
expected: Vec<usize>,
actual: Vec<usize>,
context: impl Into<String>,
) -> Self
pub fn dimension_mismatch( operation: impl Into<String>, expected: Vec<usize>, actual: Vec<usize>, context: impl Into<String>, ) -> Self
Create a dimension mismatch error
Sourcepub fn invalid_mode(
mode: usize,
max_mode: usize,
context: impl Into<String>,
) -> Self
pub fn invalid_mode( mode: usize, max_mode: usize, context: impl Into<String>, ) -> Self
Create an invalid mode error
Sourcepub fn rank_mismatch(
operation: impl Into<String>,
expected_rank: usize,
actual_rank: usize,
factor_index: usize,
) -> Self
pub fn rank_mismatch( operation: impl Into<String>, expected_rank: usize, actual_rank: usize, factor_index: usize, ) -> Self
Create a rank mismatch error
Sourcepub fn empty_input(
operation: impl Into<String>,
parameter: impl Into<String>,
) -> Self
pub fn empty_input( operation: impl Into<String>, parameter: impl Into<String>, ) -> Self
Create an empty input error
Sourcepub fn invalid_tile_size(
operation: impl Into<String>,
tile_size: usize,
reason: impl Into<String>,
) -> Self
pub fn invalid_tile_size( operation: impl Into<String>, tile_size: usize, reason: impl Into<String>, ) -> Self
Create an invalid tile size error
Trait Implementations§
Source§impl Clone for KernelError
impl Clone for KernelError
Source§fn clone(&self) -> KernelError
fn clone(&self) -> KernelError
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
Source§impl Error for KernelError
impl Error for KernelError
1.30.0§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§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for KernelError
impl PartialEq for KernelError
impl StructuralPartialEq for KernelError
Auto Trait Implementations§
impl Freeze for KernelError
impl RefUnwindSafe for KernelError
impl Send for KernelError
impl Sync for KernelError
impl Unpin for KernelError
impl UnwindSafe for KernelError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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