function identity (n, dtype) {
  var arr = zeros([n, n], dtype);
  for (var i = 0; i < n; i++) arr.set(i, i, 1);
  return arr;
}
The identity array is a square array with ones on the main diagonal.
@param {number} Number of rows (and columns) in n x n output.
@param {(String|Object)}  [dtype=Array]  The type of the output array.
@return {Array} n x n array with its main diagonal set to one, and all other elements 0