pub struct BackendCapabilities {
pub name: String,
pub version: String,
pub supported_devices: HashSet<DeviceType>,
pub supported_dtypes: HashSet<DType>,
pub features: HashSet<Feature>,
pub max_tensor_dims: usize,
pub max_tensor_size: Option<usize>,
}Expand description
Backend capabilities descriptor
Fields§
§name: String§version: String§supported_devices: HashSet<DeviceType>§supported_dtypes: HashSet<DType>§features: HashSet<Feature>§max_tensor_dims: usize§max_tensor_size: Option<usize>Implementations§
Source§impl BackendCapabilities
impl BackendCapabilities
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn with_device(self, device: DeviceType) -> Self
pub fn with_dtype(self, dtype: DType) -> Self
pub fn with_feature(self, feature: Feature) -> Self
pub fn with_max_dims(self, max_dims: usize) -> Self
pub fn supports_device(&self, device: DeviceType) -> bool
pub fn supports_dtype(&self, dtype: DType) -> bool
pub fn supports_feature(&self, feature: Feature) -> bool
pub fn can_execute_on(&self, device: DeviceType, dtype: DType) -> bool
Trait Implementations§
Source§impl Clone for BackendCapabilities
impl Clone for BackendCapabilities
Source§fn clone(&self) -> BackendCapabilities
fn clone(&self) -> BackendCapabilities
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BackendCapabilities
impl RefUnwindSafe for BackendCapabilities
impl Send for BackendCapabilities
impl Sync for BackendCapabilities
impl Unpin for BackendCapabilities
impl UnwindSafe for BackendCapabilities
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