pub trait SharedTensorAllocationDomain:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> AllocationDomainId;
fn allocate(&self, dtype: DType, shape: &[usize]) -> Result<Tensor>;
}Expand description
Backend-neutral owner of one shared tensor allocation domain.
CPU operation crates use this object-safe boundary to allocate results in the same managed domain without depending on a GPU provider crate.
§Examples
use std::sync::Arc;
use tenferro_tensor::SharedTensorAllocationDomain;
let _domain: Option<Arc<dyn SharedTensorAllocationDomain>> = None;Required Methods§
Sourcefn id(&self) -> AllocationDomainId
fn id(&self) -> AllocationDomainId
Return the stable identity shared by every allocation from this owner.