View source on GitHub |
Return the identity tensor.
tf.keras.ops.identity(
n, dtype=None
)
The identity tensor is a square tensor with ones on the main diagonal and zeros elsewhere.
Args | |
---|---|
n
|
Number of rows (and columns) in the n x n output tensor.
|
dtype
|
Data type of the output tensor. |
Returns | |
---|---|
The identity tensor. |