Skip to main content

StridedError

Enum StridedError 

Source
pub enum StridedError {
Show 19 variants RankMismatch(usize, usize), ShapeMismatch(Vec<usize>, Vec<usize>), InvalidAxis { axis: usize, rank: usize, }, StrideLengthMismatch, OffsetOverflow, ScalarConversion, NonSquare { rows: usize, cols: usize, }, NonInjectiveOutputLayout, PlanLayoutMismatch, DTypeMismatch { expected: &'static str, actual: &'static str, }, ByteLengthMismatch { dtype: &'static str, byte_len: usize, element_size: usize, }, DataAlignmentMismatch { dtype: &'static str, alignment: usize, }, InvalidBoolByte { value: u8, }, InvalidThreadBudget { max_threads: usize, }, UnsupportedDType { dtype: &'static str, }, UnsupportedOp { op: &'static str, dtype: &'static str, }, OverlappingInputOutput { input: usize, }, IntegerDivisionByZero { op: &'static str, }, UnsupportedArity { arity: usize, max: usize, },
}
Expand description

Errors that can occur during strided array operations.

Variants§

§

RankMismatch(usize, usize)

Array ranks do not match.

§

ShapeMismatch(Vec<usize>, Vec<usize>)

Array shapes are incompatible for the operation.

§

InvalidAxis

Invalid axis index for the given array rank.

Fields

§axis: usize
§rank: usize
§

StrideLengthMismatch

Stride array length doesn’t match dimensions.

§

OffsetOverflow

Integer overflow while computing array offset.

§

ScalarConversion

Failed to convert a scalar value for scaling operation.

§

NonSquare

Matrix is not square when a square matrix was required.

Fields

§rows: usize
§cols: usize
§

NonInjectiveOutputLayout

Mutable output layout maps multiple logical elements to the same memory offset.

§

PlanLayoutMismatch

Runtime view layout does not match the layout a prepared plan was compiled for.

§

DTypeMismatch

Runtime dtype does not match the dtype a prepared plan was compiled for.

Fields

§expected: &'static str
§actual: &'static str
§

ByteLengthMismatch

A byte buffer length is not a whole number of dtype elements.

Fields

§dtype: &'static str
§byte_len: usize
§element_size: usize
§

DataAlignmentMismatch

A byte buffer pointer does not satisfy the dtype alignment.

Fields

§dtype: &'static str
§alignment: usize
§

InvalidBoolByte

A byte buffer for bool contains a value that is not a valid Rust bool.

Fields

§value: u8
§

InvalidThreadBudget

An execution context requested an invalid worker-thread budget.

Fields

§max_threads: usize
§

UnsupportedDType

The dtype is recognized but unsupported by the selected operation.

Fields

§dtype: &'static str
§

UnsupportedOp

The dtype is recognized, but the selected op is not defined for it.

Fields

§op: &'static str
§dtype: &'static str
§

OverlappingInputOutput

A mutable destination overlaps one of the operation inputs.

Fields

§input: usize
§

IntegerDivisionByZero

Integer division or remainder encountered a zero divisor.

Fields

§op: &'static str
§

UnsupportedArity

The operation arity is unsupported by this entry point.

Fields

§arity: usize
§max: usize

Trait Implementations§

Source§

impl Debug for StridedError

Source§

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

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

impl Display for StridedError

Source§

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

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

impl Error for StridedError

1.30.0 · 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

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> 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> 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.