Enum ExecutionError
pub enum ExecutionError {
WithContext {
reason: String,
},
Generic {
reason: String,
backtrace: BackTrace,
},
DevicePoisoned {
reason: String,
},
}Expand description
An error that can happen when syncing a device.
Variants§
WithContext
A generic error happened during execution.
The backtrace and context information should be included in the reason string.
Generic
A generic error happened during execution thrown in the Burn project.
The full context isn’t captured by the string alone.
DevicePoisoned
The device is poisoned: a kernel faulted in a way the driver cannot recover from (an illegal memory access, a trap, a hardware fault).
Unlike the other variants, every later operation on the device fails: the process has to be restarted to use the device again.
Implementations§
§impl ExecutionError
impl ExecutionError
pub fn generic(reason: impl Into<String>) -> ExecutionError
pub fn generic(reason: impl Into<String>) -> ExecutionError
An error raised inside Burn, capturing where it was raised.
Capturing is cheap — a BackTrace resolves its frames only when it
is displayed — so this is the constructor to reach for by default.
pub fn with_context(reason: impl Into<String>) -> ExecutionError
pub fn with_context(reason: impl Into<String>) -> ExecutionError
An error from outside Burn, whose context the message already carries.
pub fn device_poisoned(reason: impl Into<String>) -> ExecutionError
pub fn device_poisoned(reason: impl Into<String>) -> ExecutionError
The device is poisoned, see ExecutionError::DevicePoisoned.
pub fn is_device_poisoned(&self) -> bool
pub fn is_device_poisoned(&self) -> bool
Whether the device from which the error originates is poisoned.
false means the operation that failed can be dropped or redone;
true means further operations on this device will fail.
Trait Implementations§
§impl Clone for ExecutionError
impl Clone for ExecutionError
§fn clone(&self) -> ExecutionError
fn clone(&self) -> ExecutionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ExecutionError
impl Debug for ExecutionError
§impl<'de> Deserialize<'de> for ExecutionError
impl<'de> Deserialize<'de> for ExecutionError
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExecutionError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExecutionError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for ExecutionError
impl Display for ExecutionError
§impl Error for ExecutionError
impl Error for ExecutionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl From<ExecutionError> for TensorReadError
impl From<ExecutionError> for TensorReadError
§fn from(source: ExecutionError) -> TensorReadError
fn from(source: ExecutionError) -> TensorReadError
§impl Serialize for ExecutionError
impl Serialize for ExecutionError
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ExecutionError
impl RefUnwindSafe for ExecutionError
impl Send for ExecutionError
impl Sync for ExecutionError
impl Unpin for ExecutionError
impl UnsafeUnpin for ExecutionError
impl UnwindSafe for ExecutionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> ErrorExt for T
impl<T> ErrorExt for T
§fn and_raise<T>(self, context: T) -> Exn<T>
fn and_raise<T>(self, context: T) -> Exn<T>
§fn raise_erased(self) -> Exnwhere
Self: Sized,
fn raise_erased(self) -> Exnwhere
Self: Sized,
§fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
fn raise_all<T, I>(self, sources: I) -> Exn<Self>where
Self: Sized,
T: Error + Send + Sync + 'static,
I: IntoIterator,
<I as IntoIterator>::Item: Into<Exn<T>>,
sources as causes.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more