torch_eye | R Documentation |
Eye
torch_eye(
n,
m = n,
dtype = NULL,
layout = NULL,
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.