latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.dist
- tensorplay.functional.dist(input, other, p=2) Tensor[source]
Returns the p-norm of (
input-other)The shapes of
inputandothermust be broadcastable.- Parameters:
Example:
>>> x = tensorplay.randn(4) >>> x tensor([-1.5393, -0.8675, 0.5916, 1.6321]) >>> y = tensorplay.randn(4) >>> y tensor([ 0.0967, -1.0511, 0.6295, 0.8360]) >>> tensorplay.dist(x, y, 3.5) tensor(1.6727) >>> tensorplay.dist(x, y, 3) tensor(1.6973) >>> tensorplay.dist(x, y, 0) tensor(4.) >>> tensorplay.dist(x, y, 1) tensor(2.6537)
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

