<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#L1931-L1957) |

Broadcast a tensor to a new shape.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.broadcast_to(
        x, shape
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | The tensor to broadcast. |
| `shape` | The shape of the desired tensor. A single integer `i` is interpreted as `(i,)`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor with the desired shape. ||

<br />

#### Examples:

    x = keras.ops.array([1, 2, 3])
    keras.ops.broadcast_to(x, (3, 3))
    array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]])