Eye
Eye
torch_eye( n, m = n, dtype = NULL, layout = torch_strided(), device = NULL, requires_grad = FALSE )
n |
(int) the number of rows |
m |
(int, optional) the number of columns with default being |
dtype |
( |
layout |
( |
device |
( |
requires_grad |
(bool, optional) If autograd should record operations on the returned tensor. Default: |
Returns a 2-D tensor with ones on the diagonal and zeros elsewhere.
if (torch_is_installed()) { torch_eye(3) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.