pub struct GpuOps { /* private fields */ }Expand description
GPU operations dispatcher with cached pipelines.
Implementations§
Source§impl GpuOps
impl GpuOps
pub fn new(device: Arc<GpuDevice>) -> Self
pub fn add(&self, a: &GpuTensor, b: &GpuTensor) -> Result<GpuTensor, String>
pub fn sub(&self, a: &GpuTensor, b: &GpuTensor) -> Result<GpuTensor, String>
pub fn mul(&self, a: &GpuTensor, b: &GpuTensor) -> Result<GpuTensor, String>
pub fn div(&self, a: &GpuTensor, b: &GpuTensor) -> Result<GpuTensor, String>
pub fn scale(&self, a: &GpuTensor, scalar: f32) -> GpuTensor
pub fn sum(&self, a: &GpuTensor) -> Result<f32, String>
pub fn mean(&self, a: &GpuTensor) -> Result<f32, String>
pub fn matmul(&self, a: &GpuTensor, b: &GpuTensor) -> Result<GpuTensor, String>
pub fn transpose(&self, a: &GpuTensor) -> Result<GpuTensor, String>
Auto Trait Implementations§
impl !Freeze for GpuOps
impl !RefUnwindSafe for GpuOps
impl Send for GpuOps
impl Sync for GpuOps
impl Unpin for GpuOps
impl UnsafeUnpin for GpuOps
impl !UnwindSafe for GpuOps
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