pub enum CpuBackendError {
Tensor(Error),
Placement {
op: &'static str,
source: CpuPlacementError,
},
ExternalRegistry(ExternalCpuDomainRegistryError),
}Expand description
Errors returned while constructing a CpuBackend.
Placement failures remain typed so callers can distinguish topology discovery failures from unsupported placement requests. Configuration and provider-selection failures retain the existing tensor error contract.
§Examples
use tenferro_cpu::{CpuBackend, CpuBackendError};
let error = CpuBackend::with_threads(0).unwrap_err();
assert!(matches!(error, CpuBackendError::Tensor(_)));Variants§
Tensor(Error)
CPU context configuration or provider selection failed.
Placement
CPU placement resolution or engine construction failed.
Fields
§
source: CpuPlacementErrorTyped placement failure.
ExternalRegistry(ExternalCpuDomainRegistryError)
Externally managed domain registry validation failed.
Implementations§
Source§impl CpuBackendError
impl CpuBackendError
Sourcepub fn placement_error(&self) -> Option<&CpuPlacementError>
pub fn placement_error(&self) -> Option<&CpuPlacementError>
Return the typed placement failure, when construction reached placement resolution.
§Examples
use tenferro_cpu::{CpuBackend, CpuBackendError};
let result: Result<CpuBackend, CpuBackendError> = CpuBackend::with_threads(1);
if let Err(error) = result {
let _placement_failure = error.placement_error();
}Trait Implementations§
Source§impl Debug for CpuBackendError
impl Debug for CpuBackendError
Source§impl Display for CpuBackendError
impl Display for CpuBackendError
Source§impl Error for CpuBackendError
impl Error for CpuBackendError
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 From<CpuBackendError> for Error
impl From<CpuBackendError> for Error
Source§fn from(error: CpuBackendError) -> Self
fn from(error: CpuBackendError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CpuBackendError
impl From<Error> for CpuBackendError
Source§impl From<ExternalCpuDomainRegistryError> for CpuBackendError
impl From<ExternalCpuDomainRegistryError> for CpuBackendError
Source§fn from(source: ExternalCpuDomainRegistryError) -> Self
fn from(source: ExternalCpuDomainRegistryError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CpuBackendError
impl !RefUnwindSafe for CpuBackendError
impl Send for CpuBackendError
impl Sync for CpuBackendError
impl Unpin for CpuBackendError
impl UnsafeUnpin for CpuBackendError
impl !UnwindSafe for CpuBackendError
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
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