pub struct CpuBackend;Expand description
The execution driver for standard host CPU memory.
Trait Implementations§
Source§impl Backend for CpuBackend
impl Backend for CpuBackend
Source§fn add(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
fn add(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
Executes an element-wise addition (a + b) and returns a dynamically allocated output tensor.
Source§fn mul(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
fn mul(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
Executes an element-wise multiplication (a * b) and returns a dynamically allocated output tensor.
Source§fn matmul(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
fn matmul(a: &Tensor, b: &Tensor) -> EtensorResult<Tensor>
Executes matrix multiplication (a @ b) and returns a dynamically allocated output tensor.
Source§fn sum_all(a: &Tensor) -> EtensorResult<Tensor>
fn sum_all(a: &Tensor) -> EtensorResult<Tensor>
Executes a global sum reduction, collapsing the tensor into a single scalar.
Source§fn mean_all(a: &Tensor) -> EtensorResult<Tensor>
fn mean_all(a: &Tensor) -> EtensorResult<Tensor>
Executes a global mean reduction, collapsing the tensor into a single scalar.
Source§fn max_all(a: &Tensor) -> EtensorResult<Tensor>
fn max_all(a: &Tensor) -> EtensorResult<Tensor>
Executes a global max reduction, collapsing the tensor into a single scalar.
Source§fn relu(a: &Tensor) -> EtensorResult<Tensor>
fn relu(a: &Tensor) -> EtensorResult<Tensor>
Executes the Rectified Linear Unit (ReLU) activation function.
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> 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