<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#L1209-L1230) |

Create a tensor.

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.array(
        x, dtype=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `dtype` | The desired data-type for the tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor. ||

<br />

#### Examples:

    keras.ops.array([1, 2, 3])
    array([1, 2, 3], dtype=int32)

    keras.ops.array([1, 2, 3], dtype="float32")
    array([1., 2., 3.], dtype=float32)