pub enum Error {
Show 20 variants
WrongElementCount {
dims: Vec<usize>,
element_count: usize,
},
XlaError {
msg: String,
backtrace: String,
},
UnexpectedElementType(i32),
UnexpectedNumberOfDims {
expected: usize,
got: usize,
dims: Vec<i64>,
},
NotAnElementType {
got: PrimitiveType,
},
NotAnArray {
expected: Option<usize>,
got: Shape,
},
UnsupportedShape {
shape: Shape,
},
UnexpectedNumberOfElemsInTuple {
expected: usize,
got: usize,
},
ElementTypeMismatch {
on_device: ElementType,
on_host: ElementType,
},
UnsupportedElementType {
ty: PrimitiveType,
op: &'static str,
},
TargetBufferIsTooLarge {
offset: usize,
shape: ArrayShape,
buffer_len: usize,
},
BinaryBufferIsTooLarge {
element_count: usize,
buffer_len: usize,
},
EmptyLiteral,
IndexOutOfBounds {
index: i64,
rank: usize,
},
Npy(String),
Io(Error),
Zip(ZipError),
ParseInt(ParseIntError),
CannotCreateLiteralWithData {
data_len_in_bytes: usize,
ty: PrimitiveType,
dims: Vec<usize>,
},
MatMulIncorrectDims {
lhs_dims: Vec<i64>,
rhs_dims: Vec<i64>,
msg: &'static str,
},
}
Expand description
Main library error type.
Variants§
WrongElementCount
Incorrect number of elements.
XlaError
Error from the xla C++ library.
UnexpectedElementType(i32)
UnexpectedNumberOfDims
NotAnElementType
Fields
§
got: PrimitiveType
NotAnArray
UnsupportedShape
UnexpectedNumberOfElemsInTuple
ElementTypeMismatch
UnsupportedElementType
TargetBufferIsTooLarge
BinaryBufferIsTooLarge
EmptyLiteral
IndexOutOfBounds
Npy(String)
Io(Error)
I/O error.
Zip(ZipError)
Zip file format error.
ParseInt(ParseIntError)
Integer parse error.
CannotCreateLiteralWithData
MatMulIncorrectDims
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)>
Returns 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<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.
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