pub enum TensorSerializationError {
ElementTypeMismatch {
expected: i32,
found: i32,
},
ShapeError(String),
Custom(String),
}Expand description
Errors surfaced by Tensor::from_proto.
Variants§
ElementTypeMismatch
Proto’s elem_type didn’t match the impl’s expected scalar.
Fields
ShapeError(String)
Proto’s shape couldn’t be interpreted as the impl’s tensor layout (e.g. byte-count mismatch, malformed dim list).
Custom(String)
Impl-specific deserialization failure.
Trait Implementations§
Source§impl Debug for TensorSerializationError
impl Debug for TensorSerializationError
Source§impl Display for TensorSerializationError
impl Display for TensorSerializationError
Source§impl Error for TensorSerializationError
impl Error for TensorSerializationError
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 TensorSerializationError
impl RefUnwindSafe for TensorSerializationError
impl Send for TensorSerializationError
impl Sync for TensorSerializationError
impl Unpin for TensorSerializationError
impl UnsafeUnpin for TensorSerializationError
impl UnwindSafe for TensorSerializationError
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