Enum candle_core::error::Error
source · pub enum Error {
Show 40 variants
UnexpectedDType {
msg: &'static str,
expected: DType,
got: DType,
},
DTypeMismatchBinaryOp {
lhs: DType,
rhs: DType,
op: &'static str,
},
UnsupportedDTypeForOp(DType, &'static str),
DimOutOfRange {
shape: Shape,
dim: i32,
op: &'static str,
},
DuplicateDimIndex {
shape: Shape,
dims: Vec<usize>,
op: &'static str,
},
UnexpectedNumberOfDims {
expected: usize,
got: usize,
shape: Shape,
},
UnexpectedShape {
msg: String,
expected: Shape,
got: Shape,
},
ShapeMismatch {
buffer_size: usize,
shape: Shape,
},
ShapeMismatchBinaryOp {
lhs: Shape,
rhs: Shape,
op: &'static str,
},
ShapeMismatchCat {
dim: usize,
first_shape: Shape,
n: usize,
nth_shape: Shape,
},
ShapeMismatchSplit {
shape: Shape,
dim: usize,
n_parts: usize,
},
OnlySingleDimension {
op: &'static str,
dims: Vec<usize>,
},
EmptyTensor {
op: &'static str,
},
DeviceMismatchBinaryOp {
lhs: DeviceLocation,
rhs: DeviceLocation,
op: &'static str,
},
NarrowInvalidArgs {
shape: Shape,
dim: usize,
start: usize,
len: usize,
msg: &'static str,
},
Conv1dInvalidArgs {
inp_shape: Shape,
k_shape: Shape,
padding: usize,
stride: usize,
msg: &'static str,
},
InvalidIndex {
op: &'static str,
index: usize,
size: usize,
},
BroadcastIncompatibleShapes {
src_shape: Shape,
dst_shape: Shape,
},
CannotSetVar {
msg: &'static str,
},
MatMulUnexpectedStriding(Box<MatMulUnexpectedStriding>),
RequiresContiguous {
op: &'static str,
},
OpRequiresAtLeastOneTensor {
op: &'static str,
},
OpRequiresAtLeastTwoTensors {
op: &'static str,
},
BackwardNotSupported {
op: &'static str,
},
NotCompiledWithCudaSupport,
NotCompiledWithMetalSupport,
CannotFindTensor {
path: String,
},
Cuda(Box<dyn Error + Send + Sync>),
Metal(MetalError),
TryFromIntError(TryFromIntError),
Npy(String),
Zip(ZipError),
ParseInt(ParseIntError),
Io(Error),
SafeTensor(SafeTensorError),
UnsupportedSafeTensorDtype(Dtype),
Wrapped(Box<dyn Error + Send + Sync>),
WithPath {
inner: Box<Self>,
path: PathBuf,
},
WithBacktrace {
inner: Box<Self>,
backtrace: Box<Backtrace>,
},
Msg(String),
}
Expand description
Main library error type.
Variants§
UnexpectedDType
DTypeMismatchBinaryOp
UnsupportedDTypeForOp(DType, &'static str)
DimOutOfRange
DuplicateDimIndex
UnexpectedNumberOfDims
UnexpectedShape
ShapeMismatch
ShapeMismatchBinaryOp
ShapeMismatchCat
ShapeMismatchSplit
OnlySingleDimension
EmptyTensor
DeviceMismatchBinaryOp
NarrowInvalidArgs
Conv1dInvalidArgs
InvalidIndex
BroadcastIncompatibleShapes
CannotSetVar
MatMulUnexpectedStriding(Box<MatMulUnexpectedStriding>)
RequiresContiguous
OpRequiresAtLeastOneTensor
OpRequiresAtLeastTwoTensors
BackwardNotSupported
NotCompiledWithCudaSupport
NotCompiledWithMetalSupport
CannotFindTensor
Cuda(Box<dyn Error + Send + Sync>)
Metal(MetalError)
TryFromIntError(TryFromIntError)
Npy(String)
Zip(ZipError)
Zip file format error.
ParseInt(ParseIntError)
Integer parse error.
Io(Error)
I/O error.
SafeTensor(SafeTensorError)
SafeTensor error.
UnsupportedSafeTensorDtype(Dtype)
Wrapped(Box<dyn Error + Send + Sync>)
Arbitrary errors wrapping.
WithPath
Adding path information to an error.
WithBacktrace
Msg(String)
User generated error message, typically created via bail!
.
Implementations§
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 From<MetalError> for Error
impl From<MetalError> for Error
source§fn from(source: MetalError) -> Self
fn from(source: MetalError) -> Self
Converts to this type from the input type.
source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
source§impl From<SafeTensorError> for Error
impl From<SafeTensorError> for Error
source§fn from(source: SafeTensorError) -> Self
fn from(source: SafeTensorError) -> Self
Converts to this type from the input type.
source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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