pub enum DlpackError {
NullManagedTensor,
IncompatibleVersion {
major: u32,
minor: u32,
},
InvalidRank(i32),
NullShape,
InvalidDimension(i64),
UnsupportedDataType {
code: u8,
bits: u8,
lanes: u16,
},
UnsupportedDevice(i32),
NullData,
IntegerConversion,
Tensor(TensorError),
}Expand description
Errors raised while validating a DLPack managed tensor.
Variants§
NullManagedTensor
A null managed-tensor pointer was supplied.
IncompatibleVersion
The ABI major version is incompatible.
InvalidRank(i32)
Rank is negative or exceeds the defensive limit.
NullShape
A ranked tensor has no shape pointer.
InvalidDimension(i64)
A dimension is negative or cannot be represented by usize.
UnsupportedDataType
The data type code is unsupported or not byte-addressable.
UnsupportedDevice(i32)
The device code is unknown to this DLPack minor implementation.
NullData
A non-empty host tensor has no data pointer.
IntegerConversion
A DLPack integer does not fit the host representation.
Tensor(TensorError)
The decoded tensor layout is invalid.
Trait Implementations§
Source§impl Debug for DlpackError
impl Debug for DlpackError
Source§impl Display for DlpackError
impl Display for DlpackError
Source§impl Error for DlpackError
impl Error for DlpackError
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<TensorError> for DlpackError
impl From<TensorError> for DlpackError
Source§fn from(source: TensorError) -> Self
fn from(source: TensorError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DlpackError
impl RefUnwindSafe for DlpackError
impl Send for DlpackError
impl Sync for DlpackError
impl Unpin for DlpackError
impl UnsafeUnpin for DlpackError
impl UnwindSafe for DlpackError
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