pub struct CpuBackend { /* private fields */ }Expand description
Pure-Rust CPU execution backend.
Implementations§
Trait Implementations§
Source§impl Debug for CpuBackend
impl Debug for CpuBackend
Source§impl Default for CpuBackend
impl Default for CpuBackend
Source§impl ExecutionBackend for CpuBackend
impl ExecutionBackend for CpuBackend
Source§fn allocate(&self, shape: &[usize], dtype: DType) -> Result<BufferHandle>
fn allocate(&self, shape: &[usize], dtype: DType) -> Result<BufferHandle>
Allocate an uninitialised buffer for the given shape and dtype.
Source§fn execute(
&self,
graph: &Graph,
inputs: HashMap<String, Tensor>,
) -> Result<Vec<Tensor>>
fn execute( &self, graph: &Graph, inputs: HashMap<String, Tensor>, ) -> Result<Vec<Tensor>>
Execute the graph, returning output tensors in the order of
graph.outputs.Source§fn supports_op(&self, op: &OpType) -> bool
fn supports_op(&self, op: &OpType) -> bool
Whether this backend can execute the given op natively.
Source§fn is_available() -> boolwhere
Self: Sized,
fn is_available() -> boolwhere
Self: Sized,
True if this backend is available on the current system.
Auto Trait Implementations§
impl !Freeze for CpuBackend
impl !RefUnwindSafe for CpuBackend
impl Send for CpuBackend
impl Sync for CpuBackend
impl Unpin for CpuBackend
impl UnsafeUnpin for CpuBackend
impl !UnwindSafe for CpuBackend
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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