tf.keras.ops.identity

Return the identity tensor.

The identity tensor is a square tensor with ones on the main diagonal and zeros elsewhere.

n Number of rows (and columns) in the n x n output tensor.
dtype Data type of the output tensor.

The identity tensor.