pub enum KernelError {
Empty,
RootOutOfBounds {
root: usize,
len: usize,
},
GradientOutOfBounds {
output: usize,
len: usize,
},
EmptyCacheOutputs,
CacheOutputOutOfBounds {
output: usize,
len: usize,
},
GradientKindMismatch {
output: usize,
actual: KernelValueKind,
},
InvalidOperand {
value: usize,
operand: usize,
},
EmptyOperands {
value: usize,
operation: &'static str,
},
KindMismatch {
value: usize,
expected: KernelValueKind,
actual: KernelValueKind,
},
ClassMismatch {
value: usize,
expected: KernelValueClass,
actual: KernelValueClass,
},
InvalidShape {
value: usize,
operation: &'static str,
message: String,
},
}Expand description
Errors produced while constructing or validating kernel IR.
Variants§
Empty
The IR contained no values.
RootOutOfBounds
The scalar root identifier was outside the value array.
GradientOutOfBounds
A gradient output identifier was outside the value array.
EmptyCacheOutputs
A cache kernel had no outputs.
CacheOutputOutOfBounds
A cache output identifier was outside the value array.
GradientKindMismatch
A gradient output was not real-valued.
InvalidOperand
An instruction referenced a value that did not precede it.
EmptyOperands
An instruction requiring operands was empty.
Fields
KindMismatch
A value’s declared kind did not match its instruction.
Fields
§
expected: KernelValueKindKind produced by the instruction.
§
actual: KernelValueKindDeclared kind.
ClassMismatch
A value’s declared evaluation class did not match its dependencies.
Fields
§
expected: KernelValueClassClass required by the dependencies.
§
actual: KernelValueClassDeclared class.
InvalidShape
Operand shapes were incompatible with an instruction.
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 (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 KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
impl Eq for KernelError
Source§impl Error for KernelError
impl Error for KernelError
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 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 UnsafeUnpin for KernelError
impl UnwindSafe for KernelError
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