#[non_exhaustive]pub enum TransferProviderContractError {
LogicalElementCount {
source: Error,
},
DTypeMismatch {
expected: DType,
actual: DType,
},
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
DestinationPlacementMismatch {
destination_engine_id: EngineId,
destination_storage_class: StorageClass,
actual: Placement,
},
DestinationResidencyMismatch {
destination_engine_id: EngineId,
destination_storage_class: StorageClass,
actual_backend_family: Option<&'static str>,
actual_allocation_domain: Option<AllocationDomainId>,
},
InvalidBufferLength {
expected: usize,
actual: usize,
},
}Expand description
Typed contract violation in a tensor returned by a transfer provider.
§Examples
use tenferro_runtime::{DType, TransferProviderContractError};
let error = TransferProviderContractError::DTypeMismatch {
expected: DType::F64,
actual: DType::F32,
};
assert!(error.to_string().contains("dtype"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
LogicalElementCount
The logical source shape cannot be represented as an element count.
DTypeMismatch
The returned tensor changed the source dtype.
Fields
ShapeMismatch
The returned tensor changed the source shape.
Fields
DestinationPlacementMismatch
The returned tensor placement is not accepted at the destination endpoint.
Fields
§
destination_storage_class: StorageClassDestination storage class from the transfer request.
DestinationResidencyMismatch
The returned tensor has compatible metadata but is not owned by the destination engine’s backend or allocation domain.
Fields
§
destination_storage_class: StorageClassDestination storage class from the transfer request.
§
actual_allocation_domain: Option<AllocationDomainId>Shared allocation domain returned by the provider.
InvalidBufferLength
The returned tensor’s buffer length does not match its shape.
Trait Implementations§
Source§impl Error for TransferProviderContractError
impl Error for TransferProviderContractError
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 TransferProviderContractError
impl !RefUnwindSafe for TransferProviderContractError
impl Send for TransferProviderContractError
impl Sync for TransferProviderContractError
impl Unpin for TransferProviderContractError
impl UnsafeUnpin for TransferProviderContractError
impl !UnwindSafe for TransferProviderContractError
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