Returns the p-norm of (input - other) The shapes of input and other must be broadcastable.

tch_dist(x, other, p = 2)

Arguments

x

tensor object

other

the Right-hand-side input tensor

p

the norm to be computed

Examples

x <- tensor(as.numeric(1:10)) y <- tensor(as.numeric(10:1)) tch_dist(x, y)
#> tensor #> 18.1659 #> [ Variable[CPUFloatType]{} ]