lu

Function lu 

Source
pub fn lu<T: Scalar>(_tensor: &Tensor<T>) -> Result<LuResult<T>>
Expand description

Compute the LU decomposition of a batched matrix (partial pivoting).

Input shape: (m, n, *). Must be column-major contiguous.

§Examples

use tenferro_linalg::lu;
use tenferro_tensor::{Tensor, MemoryOrder};
use tenferro_device::LogicalMemorySpace;

let a = Tensor::<f64>::zeros(&[3, 3],
    LogicalMemorySpace::MainMemory, MemoryOrder::ColumnMajor);
let result = lu(&a).unwrap();

§Errors

Returns an error if the input has fewer than 2 dimensions.