<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/numpy.py#L4083-L4111) |

Element-wise hypotenuse of right triangles with legs `x1` and `x2`.

#### View aliases


**Main aliases**

[`tf.keras.ops.numpy.hypot`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/hypot)

<br />

    tf.keras.ops.hypot(
        x1, x2
    )

This is equivalent to computing `sqrt(x1**2 + x2**2)` element-wise,
with shape determined by broadcasting.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x1` | A tensor, representing the first leg of the right triangle. |
| `x2` | A tensor, representing the second leg of the right triangle. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor with a shape determined by broadcasting `x1` and `x2`. ||

<br />

#### Example:

    x1 = keras.ops.convert_to_tensor([3.0, 4.0, 5.0])
    x2 = keras.ops.convert_to_tensor([4.0, 3.0, 12.0])
    keras.ops.hypot(x1, x2)
    array([5., 5., 13.], dtype=float32)

    x1 = keras.ops.convert_to_tensor([[1, 2], [3, 4]])
    x2 = keras.ops.convert_to_tensor([1, 1])
    keras.ops.hypot(x1, x2)
    array([[1.41421356 2.23606798],
          [3.16227766 4.12310563]], dtype=float32)