pub fn svdvals<T: KernelLinalgScalar, C>(
ctx: &mut C,
tensor: &Tensor<T>,
) -> Result<Tensor<T::Real>>where
C: TensorLinalgContextFor<T>,
C::Backend: 'static,Expand description
Compute singular values only for a batched matrix.
Input shape: (m, n, *).
ยงExamples
use tenferro_device::LogicalMemorySpace;
use tenferro_linalg::svdvals;
use tenferro_prims::CpuContext;
use tenferro_tensor::{MemoryOrder, Tensor};
let mut ctx = CpuContext::new(1);
let a = Tensor::<f64>::zeros(
&[3, 4],
LogicalMemorySpace::MainMemory,
MemoryOrder::ColumnMajor,
).unwrap();
let _values = svdvals(&mut ctx, &a).unwrap();