pub enum TensorError {
ShapeMismatch {
expected: Vec<usize>,
got: Vec<usize>,
},
DataLengthMismatch {
len: usize,
shape: Vec<usize>,
product: usize,
},
InvalidSubscript(String),
ContractionDimensionMismatch {
index: char,
size_a: usize,
size_b: usize,
},
}Expand description
Errors from tensor operations.
Variants§
ShapeMismatch
Shape mismatch for an operation.
DataLengthMismatch
Data length doesn’t match shape.
Fields
InvalidSubscript(String)
Invalid einsum subscript string.
ContractionDimensionMismatch
Contracted dimensions don’t match.
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
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()
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