Skip to main content

KernelError

Enum KernelError 

Source
pub enum KernelError {
Show 44 variants Tensor(TensorError), InvalidMatMulRank { left_rank: usize, right_rank: usize, }, MatMulShapeMismatch { left: Vec<usize>, right: Vec<usize>, }, ThreadPoolBuild { message: String, }, InvalidPoolRank { got_rank: usize, }, InvalidPoolParameters { kernel_h: usize, kernel_w: usize, stride_h: usize, stride_w: usize, }, PoolKernelLargerThanInput { input_h: usize, input_w: usize, kernel_h: usize, kernel_w: usize, }, InvalidConvRank { input_rank: usize, kernel_rank: usize, }, InvalidConvParameters { kernel_h: usize, kernel_w: usize, stride_h: usize, stride_w: usize, }, ConvChannelMismatch { input_channels: usize, kernel_in_channels: usize, }, ConvKernelLargerThanInput { input_h: usize, input_w: usize, kernel_h: usize, kernel_w: usize, }, ConvBiasShapeMismatch { bias_shape: Vec<usize>, out_channels: usize, }, InvalidDepthwiseConvRank { input_rank: usize, kernel_rank: usize, }, InvalidDepthwiseConvParameters { kernel_h: usize, kernel_w: usize, stride_h: usize, stride_w: usize, }, DepthwiseConvChannelMismatch { input_channels: usize, kernel_channels: usize, }, DepthwiseConvKernelLargerThanInput { input_h: usize, input_w: usize, kernel_h: usize, kernel_w: usize, }, DepthwiseConvBiasShapeMismatch { bias_shape: Vec<usize>, out_channels: usize, }, InvalidSeparablePointwiseKernelShape { pointwise_shape: Vec<usize>, }, InvalidBatchNormRank { got_rank: usize, }, BatchNormParameterShapeMismatch { parameter: &'static str, shape: Vec<usize>, expected_channels: usize, }, InvalidBatchNormEpsilon, InvalidBatchNormVariance { channel: usize, }, InvalidSoftmaxRank { got_rank: usize, }, InvalidLogSoftmaxRank { got_rank: usize, }, InvalidLogSumExpRank { got_rank: usize, }, InvalidLayerNormRank { got_rank: usize, }, LayerNormParameterShapeMismatch { parameter: &'static str, shape: Vec<usize>, expected_features: usize, }, InvalidLayerNormEpsilon, InvalidAttentionRank { query_rank: usize, key_rank: usize, value_rank: usize, }, AttentionDkMismatch { query_dk: usize, key_dk: usize, }, AttentionSeqKMismatch { key_seq: usize, value_seq: usize, }, AttentionMaskShapeMismatch { expected: Vec<usize>, got: Vec<usize>, }, InvalidGroupNormRank { got_rank: usize, }, GroupNormChannelGroupMismatch { channels: usize, num_groups: usize, }, GroupNormParameterShapeMismatch { parameter: &'static str, shape: Vec<usize>, expected_channels: usize, }, InvalidGroupNormEpsilon, InvalidGroupNormNumGroups, InvalidRmsNormRank { got_rank: usize, }, RmsNormParameterShapeMismatch { parameter: &'static str, shape: Vec<usize>, expected_features: usize, }, InvalidRmsNormEpsilon, InvalidEmbeddingWeightRank { got_rank: usize, }, EmbeddingIndexOutOfBounds { index: usize, vocab_size: usize, }, DeformableConvOffsetShapeMismatch { expected: Vec<usize>, got: Vec<usize>, }, Gpu { message: String, },
}
Expand description

Errors returned by kernel backends.

Variants§

§

Tensor(TensorError)

§

InvalidMatMulRank

Fields

§left_rank: usize
§right_rank: usize
§

MatMulShapeMismatch

Fields

§left: Vec<usize>
§right: Vec<usize>
§

ThreadPoolBuild

Fields

§message: String
§

InvalidPoolRank

Fields

§got_rank: usize
§

InvalidPoolParameters

Fields

§kernel_h: usize
§kernel_w: usize
§stride_h: usize
§stride_w: usize
§

PoolKernelLargerThanInput

Fields

§input_h: usize
§input_w: usize
§kernel_h: usize
§kernel_w: usize
§

InvalidConvRank

Fields

§input_rank: usize
§kernel_rank: usize
§

InvalidConvParameters

Fields

§kernel_h: usize
§kernel_w: usize
§stride_h: usize
§stride_w: usize
§

ConvChannelMismatch

Fields

§input_channels: usize
§kernel_in_channels: usize
§

ConvKernelLargerThanInput

Fields

§input_h: usize
§input_w: usize
§kernel_h: usize
§kernel_w: usize
§

ConvBiasShapeMismatch

Fields

§bias_shape: Vec<usize>
§out_channels: usize
§

InvalidDepthwiseConvRank

Fields

§input_rank: usize
§kernel_rank: usize
§

InvalidDepthwiseConvParameters

Fields

§kernel_h: usize
§kernel_w: usize
§stride_h: usize
§stride_w: usize
§

DepthwiseConvChannelMismatch

Fields

§input_channels: usize
§kernel_channels: usize
§

DepthwiseConvKernelLargerThanInput

Fields

§input_h: usize
§input_w: usize
§kernel_h: usize
§kernel_w: usize
§

DepthwiseConvBiasShapeMismatch

Fields

§bias_shape: Vec<usize>
§out_channels: usize
§

InvalidSeparablePointwiseKernelShape

Fields

§pointwise_shape: Vec<usize>
§

InvalidBatchNormRank

Fields

§got_rank: usize
§

BatchNormParameterShapeMismatch

Fields

§parameter: &'static str
§shape: Vec<usize>
§expected_channels: usize
§

InvalidBatchNormEpsilon

§

InvalidBatchNormVariance

Fields

§channel: usize
§

InvalidSoftmaxRank

Fields

§got_rank: usize
§

InvalidLogSoftmaxRank

Fields

§got_rank: usize
§

InvalidLogSumExpRank

Fields

§got_rank: usize
§

InvalidLayerNormRank

Fields

§got_rank: usize
§

LayerNormParameterShapeMismatch

Fields

§parameter: &'static str
§shape: Vec<usize>
§expected_features: usize
§

InvalidLayerNormEpsilon

§

InvalidAttentionRank

Fields

§query_rank: usize
§key_rank: usize
§value_rank: usize
§

AttentionDkMismatch

Fields

§query_dk: usize
§key_dk: usize
§

AttentionSeqKMismatch

Fields

§key_seq: usize
§value_seq: usize
§

AttentionMaskShapeMismatch

Fields

§expected: Vec<usize>
§got: Vec<usize>
§

InvalidGroupNormRank

Fields

§got_rank: usize
§

GroupNormChannelGroupMismatch

Fields

§channels: usize
§num_groups: usize
§

GroupNormParameterShapeMismatch

Fields

§parameter: &'static str
§shape: Vec<usize>
§expected_channels: usize
§

InvalidGroupNormEpsilon

§

InvalidGroupNormNumGroups

§

InvalidRmsNormRank

Fields

§got_rank: usize
§

RmsNormParameterShapeMismatch

Fields

§parameter: &'static str
§shape: Vec<usize>
§expected_features: usize
§

InvalidRmsNormEpsilon

§

InvalidEmbeddingWeightRank

Fields

§got_rank: usize
§

EmbeddingIndexOutOfBounds

Fields

§index: usize
§vocab_size: usize
§

DeformableConvOffsetShapeMismatch

Fields

§expected: Vec<usize>
§got: Vec<usize>
§

Gpu

Fields

§message: String

Trait Implementations§

Source§

impl Clone for KernelError

Source§

fn clone(&self) -> KernelError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KernelError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for KernelError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for KernelError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TensorError> for KernelError

Source§

fn from(source: TensorError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for KernelError

Source§

fn eq(&self, other: &KernelError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for KernelError

Source§

impl StructuralPartialEq for KernelError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.