eye

Returns a 2D tensor with shape (n, n), with ones on the diagonal and zeros elsewhere.

Return

a 2-D tensor with ones on the diagonal and zeros elsewhere.

Parameters

n

the number of rows and columns