View source: R/gen-namespace.R
torch_trace | R Documentation |
Trace
torch_trace(self)
self |
the input tensor |
Returns the sum of the elements of the diagonal of the input 2-D matrix.
if (torch_is_installed()) {
x <- torch_arange(1, 9)$view(c(3, 3))
x
torch_trace(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.