Function numeric::linalg::diag [] [src]

pub fn diag<T: Copy + Zero>(a: &Tensor<T>) -> Tensor<T>

If passed a vector, creates a diagonal matrix with the vector as its diagonal. If passed a matrix, the diagonal is extracted and returned.