Skip to main content

StridedError

Enum StridedError 

Source
pub enum StridedError {
Show 20 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, }, UnsupportedDType { dtype: &'static str, }, UnsupportedOp { op: &'static str, dtype: &'static str, }, OverlappingInputOutput { input: usize, }, InvalidRunIndex, IndexOutOfRange { index: i64, runs: 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.

Raised when is_injective_layout returns false; see its documentation for the one size-bounded residual it reports as false without deciding.

§

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
§

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
§

InvalidRunIndex

A prepared run index’s offsets are not a monotone prefix sum over its rows.

Raised when run offsets do not start at zero or step downwards.

§

IndexOutOfRange

A gathered destination index lies outside the run range.

Raised when an index is negative or is not below the run count, including any index when there are no runs.

Fields

§index: i64
§runs: 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<(), Error>

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

impl Display for StridedError

Source§

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

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.