<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#L9760-L9811) |

Splits an array into multiple sub-arrays (unevenly).

#### View aliases


**Main aliases**

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

<br />

    tf.keras.ops.array_split(
        x, indices_or_sections, axis=0
    )

This is similar to [`keras.ops.split`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/split), but it allows for
unequal splits. `indices_or_sections` must be an integer
that indicates the total number of sub-arrays to create.
If the tensor cannot be divided evenly, the first `remainder`
splits will have size `quotient + 1`, and the rest will
have size `quotient`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |
| `indices_or_sections` | An integer indicating the number of sub-arrays to create. |
| `axis` | The axis along which to split. Defaults to 0. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A list of sub-tensors. ||

<br />

#### Example:

    x = keras.ops.arange(10)
    keras.ops.array_split(x, 3)
    (array([0, 1, 2, 3], dtype=int32),
     array([4, 5, 6], dtype=int32),
     array([7, 8, 9], dtype=int32))