pub enum Error {
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
SizeMismatch {
expected: usize,
actual: usize,
},
CopyFailed {
reason: String,
},
InvalidDevice {
device: String,
},
NotAllocated,
NotCpuAccessible,
TypeMismatch {
expected: DType,
actual: DType,
},
NdarrayShape {
source: ShapeError,
},
InvalidView {
offset: usize,
size: usize,
buffer_size: usize,
},
Runtime {
message: String,
},
}Variants§
ShapeMismatch
Shape of target tensor does not match expected shape.
SizeMismatch
CopyFailed
Failed to copy data between host and device.
InvalidDevice
Invalid device specification.
NotAllocated
Buffer is not allocated.
NotCpuAccessible
Buffer is not CPU-accessible (device buffers require copyout).
TypeMismatch
Element type mismatch.
NdarrayShape
Failed to create ndarray view from buffer shape.
Fields
§
source: ShapeErrorInvalidView
Invalid buffer view parameters.
Runtime
Runtime execution error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreSource§impl<__T0> IntoError<Error> for CopyFailedSnafu<__T0>
impl<__T0> IntoError<Error> for CopyFailedSnafu<__T0>
Source§impl<__T0> IntoError<Error> for InvalidDeviceSnafu<__T0>
impl<__T0> IntoError<Error> for InvalidDeviceSnafu<__T0>
Source§impl<__T0, __T1, __T2> IntoError<Error> for InvalidViewSnafu<__T0, __T1, __T2>
impl<__T0, __T1, __T2> IntoError<Error> for InvalidViewSnafu<__T0, __T1, __T2>
Source§impl IntoError<Error> for NdarrayShapeSnafu
impl IntoError<Error> for NdarrayShapeSnafu
Source§type Source = ShapeError
type Source = ShapeError
The underlying error
Source§fn into_error(self, error: Self::Source) -> Error
fn into_error(self, error: Self::Source) -> Error
Combine the information to produce the error
Source§impl IntoError<Error> for NotAllocatedSnafu
impl IntoError<Error> for NotAllocatedSnafu
Source§impl IntoError<Error> for NotCpuAccessibleSnafu
impl IntoError<Error> for NotCpuAccessibleSnafu
Source§impl<__T0> IntoError<Error> for RuntimeSnafu<__T0>
impl<__T0> IntoError<Error> for RuntimeSnafu<__T0>
Source§impl<__T0, __T1> IntoError<Error> for ShapeMismatchSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for ShapeMismatchSnafu<__T0, __T1>
Source§impl<__T0, __T1> IntoError<Error> for SizeMismatchSnafu<__T0, __T1>
impl<__T0, __T1> IntoError<Error> for SizeMismatchSnafu<__T0, __T1>
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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