lib/ops.js
function eye(arg0, datatype) {
    var n, m;
    if (Array.isArray(arg0)) {
        n = arg0[0];
        if (arg0.length > 1) {
            m = arg0[1];
        }
        else {
            m = n;
        }
    }
    else {
        n = m = arg0;
    }
    var A = new ndarray_1.NDArray({ shape: [n, m], datatype: datatype, fill: 0 });
    var ndiag = Math.min(n, m);
    for (var i = 0; i < ndiag; i++) {
        A.set(i, i, 1);
    }
    return A;
}
function eye(arg0, datatype) {
    var n, m;
    if (Array.isArray(arg0)) {
        n = arg0[0];
        if (arg0.length > 1) {
            m = arg0[1];
        }
        else {
            m = n;
        }
    }
    else {
        n = m = arg0;
    }
    var A = new ndarray_1.NDArray({ shape: [n, m], datatype: datatype, fill: 0 });
    var ndiag = Math.min(n, m);
    for (var i = 0; i < ndiag; i++) {
        A.set(i, i, 1);
    }
    return A;
}
function eye ( arg0 , datatype ) { var n , m ; if ( Array . isArray ( arg0 ) ) { n = arg0 [ 0 ] ; if ( arg0 . length > 1 ) { m = arg0 [ 1 ] ; } else { m = n ; } } else { n = m = arg0 ; } var A = new ndarray_1 . NDArray ( { shape : [ n , m ] , datatype : datatype , fill : 0 } ) ; var ndiag = Math . min ( n , m ) ; for ( var i = 0 ; i < ndiag ; i ++ ) { A . set ( i , i , 1 ) ; } return A ; }
Creates m-by-n Identity matrix

```
eye(2) // Creates 2x2 Identity matrix
eye([2,2]) // Creates 2x2 Identity matrix
eye([2,3]) // Create 2x3 Identity matrix with main diagonal set to 1
eye(2,'i32') // Creates 2x2 Identity matrix of 32-bit integers
```
Creates m - by - n Identity matrix