<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#L8958-L8972) |

Remove axes of length one from `x`.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.squeeze(
        x, axis=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `axis` | Select a subset of the entries of length one in the shape. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The input tensor with all or a subset of the dimensions of length 1 removed. ||

<br />