pub enum TensorError {
CastError,
InvalidShape(usize),
IndexOutOfBounds(usize),
StorageError(TensorAllocatorError),
DimensionMismatch(String),
UnsupportedOperation(String),
}Expand description
An error type for tensor operations.
Variants§
CastError
Error when the cast operation fails.
InvalidShape(usize)
The number of elements in the data does not match the shape of the tensor.
IndexOutOfBounds(usize)
Index out of bounds.
StorageError(TensorAllocatorError)
Error with the tensor storage.
DimensionMismatch(String)
Dimension mismatch for operations requiring compatible shapes.
UnsupportedOperation(String)
Unsupported operation for the given data type or tensor configuration.
Trait Implementations§
Source§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
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<TensorAllocatorError> for TensorError
impl From<TensorAllocatorError> for TensorError
Source§fn from(source: TensorAllocatorError) -> Self
fn from(source: TensorAllocatorError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TensorError
impl PartialEq 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 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