mindspore.ops.hypot

mindspore.ops.hypot(input, other)[source]

Given the legs of a right triangle, return its hypotenuse, element-wise.

Support broadcasting and type promotion.

\[out_i = \sqrt{input_i^2 + other_i^2}\]
Parameters
  • input (Tensor) – The first input tensor.

  • other (Tensor) – The second input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([3., 5., 7.])
>>> other = mindspore.tensor([4., 12., 24.])
>>> output = mindspore.ops.hypot(input, other)
>>> print(output)
[ 5. 13. 25.]