klyn.math.NDArray.eye
method
public static eye(size as Int) as NDArray<T>:
Description

Creates a new NDArray with ones on the diagonal and zeros elsewhere.

Parameters
ParameterDescription
sizeThe size of the square matrix.
Returns

A new identity matrix.

Example
arr = NDArray<Int>.eye(3)