pub enum TensorError {
UnspecifiedDtype,
NegativeDim(i64),
NegativeStride(i64),
StrideRankMismatch {
strides: usize,
shape: usize,
},
ByteLengthMismatch {
expected: usize,
actual: usize,
},
OutOfBounds {
required: usize,
byte_offset: usize,
available: usize,
},
NumelMismatch {
from: usize,
to: usize,
},
AmbiguousReshape,
EmptyStack,
StackMismatch {
index: usize,
},
UnstackScalar,
Overflow,
}Expand description
Errors raised by Tensor constructors and transformations.
Variants§
UnspecifiedDtype
NegativeDim(i64)
NegativeStride(i64)
StrideRankMismatch
ByteLengthMismatch
OutOfBounds
NumelMismatch
AmbiguousReshape
EmptyStack
StackMismatch
UnstackScalar
Overflow
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
impl Eq 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 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 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