Function qr
pub fn qr<T, C>(ctx: &mut C, tensor: &Tensor<T>) -> Result<QrResult<T>, Error>where
T: KernelLinalgScalar,
C: TensorLinalgContextFor<T>,
<C as TensorLinalgContextFor<T>>::Backend: 'static,Expand description
Compute the QR decomposition of a batched matrix.
Input shape: (m, n, *).
The function internally normalizes input to column-major contiguous layout. If the input is not already contiguous, an internal copy is performed.
§Examples
use tenferro_device::LogicalMemorySpace;
use tenferro_linalg::qr;
use tenferro_prims::CpuContext;
use tenferro_tensor::{MemoryOrder, Tensor};
let mut ctx = CpuContext::new(1);
let a = Tensor::<f64>::zeros(
&[4, 3],
LogicalMemorySpace::MainMemory,
MemoryOrder::ColumnMajor,
).unwrap();
let _result = qr(&mut ctx, &a).unwrap();§Errors
Returns an error if the input has fewer than 2 dimensions.