pub trait InplaceOp1 {
// Required methods
fn name(&self) -> &'static str;
fn cpu_fwd(&self, storage: &mut CpuStorage, layout: &Layout) -> Result<()>;
// Provided methods
fn cuda_fwd(
&self,
_storage: &mut CudaStorage,
_layout: &Layout,
) -> Result<()> { ... }
fn metal_fwd(
&self,
_storage: &mut MetalStorage,
_layout: &Layout,
) -> Result<()> { ... }
}
Expand description
Unary ops that can be defined in user-land. These ops work in place and as such back-prop is unsupported.