pub fn mindim(dims: &[usize]) -> usize
Get the minimum dimension from a slice of dimensions. This is used for DiagTensor where all indices must have the same dimension.