Dist
dist(input, other, p=2) -> Tensor
Returns the p-norm of (input
- other
)
The shapes of input
and other
must be
broadcastable .
Examples
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)
}
#> torch_tensor
#> 1.93941
#> [ CPUFloatType{} ]