<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#L3468-L3489) |

Expand the shape of a tensor.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.expand_dims(
        x, axis
    )

Insert a new axis at the `axis` position in the expanded tensor shape.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `axis` | Position in the expanded axes where the new axis (or axes) is placed. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Output tensor with the number of dimensions increased. ||

<br />