Skip to main content

eye

Function eye 

Source
pub fn eye<T: Element>(
    n: usize,
    m: usize,
    k: isize,
) -> FerrayResult<Array<T, Ix2>>
Expand description

Create a 2-D array with ones on the diagonal and zeros elsewhere.

k is the diagonal offset: 0 = main diagonal, positive = above, negative = below.

Analogous to numpy.eye(N, M, k).