PyTorch
torch / torch
torch.hypot¶
-
torch.
hypot
(input, other, *, out=None) → Tensor¶ Given the legs of a right triangle, return its hypotenuse.
outi=inputi2+otheri2The shapes of
input
andother
must be broadcastable.- Parameters
- Keyword Arguments
out (Tensor, optional) – the output tensor.
Example:
>>> a = torch.hypot(torch.tensor([4.0]), torch.tensor([3.0, 4.0, 5.0])) tensor([5.0000, 5.6569, 6.4031])
此页内容是否对您有帮助
感谢反馈!