pub enum DataError {
StorageAccess(AccessError),
InvalidRepresentation(CheckedCastError),
DTypeMismatch {
expected: DType,
actual: DType,
},
UnsupportedConversion {
from: DType,
to: DType,
},
ElementCountMismatch {
expected: usize,
actual: usize,
},
}Expand description
Errors that can occur while accessing or converting TensorData.
Variants§
StorageAccess(AccessError)
Host access to the underlying storage failed.
InvalidRepresentation(CheckedCastError)
The stored bytes aren’t a valid representation of the requested element type.
DTypeMismatch
The stored dtype doesn’t match the requested dtype.
UnsupportedConversion
Unsupported data conversion.
ElementCountMismatch
The byte storage doesn’t match the number of elements described by the shape.
Trait Implementations§
impl Eq for DataError
Source§impl Error for DataError
impl Error for DataError
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<AccessError> for DataError
impl From<AccessError> for DataError
Source§fn from(source: AccessError) -> Self
fn from(source: AccessError) -> Self
Converts to this type from the input type.
Source§impl From<DataError> for TensorReadError
impl From<DataError> for TensorReadError
impl StructuralPartialEq for DataError
Auto Trait Implementations§
impl Freeze for DataError
impl RefUnwindSafe for DataError
impl Send for DataError
impl Sync for DataError
impl Unpin for DataError
impl UnsafeUnpin for DataError
impl UnwindSafe for DataError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.