# tf.sparse.split

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/sparse/split) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/sparse_ops.py#L841-L912) |

Split a `SparseTensor` into `num_split` tensors along `axis`. (deprecated arguments)

#### View aliases


**Main aliases**

\`tf.sparse_split\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.sparse.split`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/sparse_split), [`tf.compat.v1.sparse_split`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/sparse_split)

<br />

    tf.sparse.split(
        keyword_required=KeywordRequired(), sp_input=None, num_split=None, axis=None,
        name=None, split_dim=None
    )

> [!WARNING]
> **Warning:** SOME ARGUMENTS ARE DEPRECATED: `(split_dim)`. They will be removed in a future version. Instructions for updating: split_dim is deprecated, use axis instead

If the `sp_input.dense_shape[axis]` is not an integer multiple of `num_split`
each slice starting from 0:`shape[axis] % num_split` gets extra one
dimension. For example, if `axis = 1` and `num_split = 2` and the
input is:

    input_tensor = shape = [2, 7]
    [    a   d e  ]
    [b c          ]

Graphically the output tensors are:

    output_tensor[0] =
    [    a   ]
    [b c     ]

    output_tensor[1] =
    [ d e  ]
    [      ]

<br />

<br />

<br />

| ## Args ||
|---|---|
| `keyword_required` | Python 2 standin for \* (temporary for argument reorder) |
| `sp_input` | The `SparseTensor` to split. |
| `num_split` | A Python integer. The number of ways to split. |
| `axis` | A 0-D `int32` `Tensor`. The dimension along which to split. |
| `name` | A name for the operation (optional). |
| `split_dim` | Deprecated old name for axis. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `num_split` `SparseTensor` objects resulting from splitting `value`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If `sp_input` is not a `SparseTensor`. |
| `ValueError` | If the deprecated `split_dim` and `axis` are both non None. |

<br />