tf.keras.ops.identity

Return the identity tensor.

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

nNumber of rows (and columns) in the n x n output tensor.
dtypeData type of the output tensor.

The identity tensor.