Skip to main content

MatrixOps

Trait MatrixOps 

Source
pub trait MatrixOps {
    // Required methods
    fn matmul(&self, other: &Tensor) -> Result<Tensor>;
    fn transpose(&self) -> Result<Tensor>;
    fn transpose_dims(&self, dim1: usize, dim2: usize) -> Result<Tensor>;
    fn batch_matmul(&self, other: &Tensor) -> Result<Tensor>;
}
Expand description

Trait for matrix operations on tensors.

Required Methods§

Source

fn matmul(&self, other: &Tensor) -> Result<Tensor>

Matrix multiplication.

Source

fn transpose(&self) -> Result<Tensor>

Transpose the tensor (swap last two dimensions).

Source

fn transpose_dims(&self, dim1: usize, dim2: usize) -> Result<Tensor>

Transpose with specific dimension indices.

Source

fn batch_matmul(&self, other: &Tensor) -> Result<Tensor>

Batch matrix multiplication.

Implementors§