linalg:eye
(linalg:eye n &key element-type)
Creates the n-by-n identity matrix: ones on the main diagonal, zeros everywhere else. Multiplying by it with linalg:matmul leaves a matrix unchanged, and it is a convenient reference operand for linalg:array-equal. Double-float by default; pass :element-type 'single-float for a packed single-float (#f) result. :element-type 'bfloat16 builds a packed bfloat16 (#bf16) array instead, on the interpreter and the JVM only (Single-float precision).