View source: R/gen-namespace.R
torch_dist | R Documentation |
Dist
torch_dist(self, other, p = 2L)
self |
(Tensor) the input tensor. |
other |
(Tensor) the Right-hand-side input tensor |
p |
(float, optional) the norm to be computed |
Returns the p-norm of (input
- other
)
The shapes of input
and other
must be
broadcastable .
if (torch_is_installed()) {
x = torch_randn(c(4))
x
y = torch_randn(c(4))
y
torch_dist(x, y, 3.5)
torch_dist(x, y, 3)
torch_dist(x, y, 0)
torch_dist(x, y, 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.