pub enum TensorError {
InvalidDataType,
RankMismatch {
shape: usize,
strides: usize,
},
LayoutOverflow,
StorageOutOfBounds {
start: i128,
end: i128,
available: usize,
},
DeviceNotHostAccessible(Device),
DataTypeMismatch {
expected: DataType,
actual: DataType,
},
}Expand description
Tensor construction and layout errors.
Variants§
InvalidDataType
The data type has no bits or lanes, or cannot address whole bytes.
RankMismatch
The stride rank differs from the shape rank.
LayoutOverflow
Shape, stride, or byte-range arithmetic overflowed.
StorageOutOfBounds
The byte offset or reachable tensor span lies outside storage.
Fields
DeviceNotHostAccessible(Device)
A host slice was paired with a device that is not host-accessible.
DataTypeMismatch
Typed storage does not match its descriptor dtype.
Trait Implementations§
Source§impl Clone for TensorError
impl Clone for TensorError
Source§fn clone(&self) -> TensorError
fn clone(&self) -> TensorError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorError
impl Debug for TensorError
Source§impl Display for TensorError
impl Display for TensorError
Source§impl Error for TensorError
impl Error for TensorError
1.30.0 · 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.
Source§impl From<TensorError> for SpatialTensorBridgeError
impl From<TensorError> for SpatialTensorBridgeError
Source§fn from(source: TensorError) -> Self
fn from(source: TensorError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TensorError
impl PartialEq for TensorError
Source§fn eq(&self, other: &TensorError) -> bool
fn eq(&self, other: &TensorError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TensorError
impl StructuralPartialEq for TensorError
Auto Trait Implementations§
impl Freeze for TensorError
impl RefUnwindSafe for TensorError
impl Send for TensorError
impl Sync for TensorError
impl Unpin for TensorError
impl UnsafeUnpin for TensorError
impl UnwindSafe for TensorError
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