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][ade][bc]
Graphically the output tensors are:
output_tensor[0]=[a][bc]output_tensor[1]=[de][]
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 int32Tensor. The dimension along which to split. Must be in
range [-rank, rank), where rank is the number of dimensions in the input
SparseTensor.
name
A name for the operation (optional).
split_dim
Deprecated old name for axis.
Returns
num_splitSparseTensor objects resulting from splitting value.
Raises
TypeError
If sp_input is not a SparseTensor.
ValueError
If the deprecated split_dim and axis are both non None.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.sparse_split\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/sparse_ops.py#L991-L1064) |\n\nSplit a `SparseTensor` into `num_split` tensors along `axis`. (deprecated arguments)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.sparse.split`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/sparse_split)\n\n\u003cbr /\u003e\n\n tf.compat.v1.sparse_split(\n keyword_required=KeywordRequired(),\n sp_input=None,\n num_split=None,\n axis=None,\n name=None,\n split_dim=None\n )\n\n| **Deprecated:** SOME ARGUMENTS ARE DEPRECATED: `(split_dim)`. They will be removed in a future version. Instructions for updating: split_dim is deprecated, use axis instead\n\nIf the `sp_input.dense_shape[axis]` is not an integer multiple of `num_split`\neach slice starting from 0:`shape[axis] % num_split` gets extra one\ndimension. For example, if `axis = 1` and `num_split = 2` and the\ninput is: \n\n input_tensor = shape = [2, 7]\n [ a d e ]\n [b c ]\n\nGraphically the output tensors are: \n\n output_tensor[0] =\n [ a ]\n [b c ]\n\n output_tensor[1] =\n [ d e ]\n [ ]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `keyword_required` | Python 2 standin for \\* (temporary for argument reorder) |\n| `sp_input` | The `SparseTensor` to split. |\n| `num_split` | A Python integer. The number of ways to split. |\n| `axis` | A 0-D `int32` `Tensor`. The dimension along which to split. Must be in range \\[-rank, rank), where rank is the number of dimensions in the input `SparseTensor`. |\n| `name` | A name for the operation (optional). |\n| `split_dim` | Deprecated old name for axis. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| `num_split` `SparseTensor` objects resulting from splitting `value`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|-------------------------------------------------------------|\n| `TypeError` | If `sp_input` is not a `SparseTensor`. |\n| `ValueError` | If the deprecated `split_dim` and `axis` are both non None. |\n\n\u003cbr /\u003e"]]