pub struct Cpu;Expand description
CPU backend using Vec storage.
Trait Implementations§
Source§impl Backend for Cpu
impl Backend for Cpu
Source§fn synchronize(&self)
fn synchronize(&self)
Synchronize all pending operations.
Source§fn contract<A: Algebra>(
&self,
a: &Self::Storage<A::Scalar>,
shape_a: &[usize],
strides_a: &[usize],
modes_a: &[i32],
b: &Self::Storage<A::Scalar>,
shape_b: &[usize],
strides_b: &[usize],
modes_b: &[i32],
shape_c: &[usize],
modes_c: &[i32],
) -> Self::Storage<A::Scalar>where
A::Scalar: BackendScalar<Self>,
fn contract<A: Algebra>(
&self,
a: &Self::Storage<A::Scalar>,
shape_a: &[usize],
strides_a: &[usize],
modes_a: &[i32],
b: &Self::Storage<A::Scalar>,
shape_b: &[usize],
strides_b: &[usize],
modes_b: &[i32],
shape_c: &[usize],
modes_c: &[i32],
) -> Self::Storage<A::Scalar>where
A::Scalar: BackendScalar<Self>,
Binary tensor contraction. Read more
Source§fn contract_with_argmax<A: Algebra<Index = u32>>(
&self,
a: &Self::Storage<A::Scalar>,
shape_a: &[usize],
strides_a: &[usize],
modes_a: &[i32],
b: &Self::Storage<A::Scalar>,
shape_b: &[usize],
strides_b: &[usize],
modes_b: &[i32],
shape_c: &[usize],
modes_c: &[i32],
) -> (Self::Storage<A::Scalar>, Self::Storage<u32>)where
A::Scalar: BackendScalar<Self>,
fn contract_with_argmax<A: Algebra<Index = u32>>(
&self,
a: &Self::Storage<A::Scalar>,
shape_a: &[usize],
strides_a: &[usize],
modes_a: &[i32],
b: &Self::Storage<A::Scalar>,
shape_b: &[usize],
strides_b: &[usize],
modes_b: &[i32],
shape_c: &[usize],
modes_c: &[i32],
) -> (Self::Storage<A::Scalar>, Self::Storage<u32>)where
A::Scalar: BackendScalar<Self>,
Contraction with argmax tracking for tropical backpropagation. Read more
impl<T: Scalar> BackendScalar<Cpu> for T
Auto Trait Implementations§
impl Freeze for Cpu
impl RefUnwindSafe for Cpu
impl Send for Cpu
impl Sync for Cpu
impl Unpin for Cpu
impl UnwindSafe for Cpu
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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