pub trait HardwareOps {
// Required methods
fn matmul_hw(
&self,
other: &Tensor,
device: &HardwareDevice,
) -> Result<Tensor>;
fn conv2d_hw(
&self,
kernel: &Tensor,
device: &HardwareDevice,
) -> Result<Tensor>;
fn elementwise_hw(
&self,
op: ElementwiseOp,
device: &HardwareDevice,
) -> Result<Tensor>;
}Expand description
Hardware-accelerated operations trait
Required Methods§
Sourcefn matmul_hw(&self, other: &Tensor, device: &HardwareDevice) -> Result<Tensor>
fn matmul_hw(&self, other: &Tensor, device: &HardwareDevice) -> Result<Tensor>
Matrix multiplication on hardware
Sourcefn conv2d_hw(&self, kernel: &Tensor, device: &HardwareDevice) -> Result<Tensor>
fn conv2d_hw(&self, kernel: &Tensor, device: &HardwareDevice) -> Result<Tensor>
Convolution on hardware
Sourcefn elementwise_hw(
&self,
op: ElementwiseOp,
device: &HardwareDevice,
) -> Result<Tensor>
fn elementwise_hw( &self, op: ElementwiseOp, device: &HardwareDevice, ) -> Result<Tensor>
Element-wise operations on hardware