pub enum IntoValueError<H> {
NotUnique(H),
Extract {
value: H,
error: GroupError,
},
}Expand description
Error returned when a value cannot be consumed without changing its owner.
§Examples
use tenferro_ad::{EagerRuntime, EagerTensor, IntoValueError, Tensor};
use tenferro_cpu::CpuBackend;
let ctx = EagerRuntime::with_cpu_backend(CpuBackend::new())?;
let value = EagerTensor::from_tensor_in(
Tensor::from_vec_col_major(vec![1], vec![1.0_f64])?,
ctx,
)?;
let _shared = value.clone();
assert!(matches!(
value.into_value(),
Err(IntoValueError::NotUnique(_))
));Variants§
NotUnique(H)
Another eager handle, tape record, or checkpoint retains the value.
Extract
Group extraction failed after the handle was uniquely acquired.
Trait Implementations§
Source§impl<H: Debug> Debug for IntoValueError<H>
impl<H: Debug> Debug for IntoValueError<H>
Source§impl<H> Display for IntoValueError<H>
impl<H> Display for IntoValueError<H>
Source§impl<H: Debug + Send + Sync + 'static> Error for IntoValueError<H>
impl<H: Debug + Send + Sync + 'static> Error for IntoValueError<H>
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<H> Freeze for IntoValueError<H>where
H: Freeze,
impl<H> RefUnwindSafe for IntoValueError<H>where
H: RefUnwindSafe,
impl<H> Send for IntoValueError<H>where
H: Send,
impl<H> Sync for IntoValueError<H>where
H: Sync,
impl<H> Unpin for IntoValueError<H>where
H: Unpin,
impl<H> UnsafeUnpin for IntoValueError<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for IntoValueError<H>where
H: UnwindSafe,
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
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more