pub trait TensorAllocator: Clone {
// Required methods
fn alloc(&self, layout: Layout) -> Result<*mut u8, TensorAllocatorError>;
fn dealloc(&self, ptr: *mut u8, layout: Layout);
}Expand description
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl TensorAllocator for CpuAllocator
Implement the TensorAllocator trait for the CpuAllocator struct.