<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#L157-L177) |

Compute the absolute value element-wise.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.absolute(
        x
    )

[`keras.ops.abs`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/abs) is a shorthand for this function.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An array containing the absolute value of each element in `x`. ||

<br />

#### Example:

    x = keras.ops.convert_to_tensor([-1.2, 1.2])
    keras.ops.absolute(x)
    array([1.2, 1.2], dtype=float32)