tf.raw_ops.SparseSplit
Stay organized with collections
Save and categorize content based on your preferences.
Split a SparseTensor
into num_split
tensors along one dimension.
tf.raw_ops.SparseSplit(
split_dim, indices, values, shape, num_split, name=None
)
If the shape[split_dim]
is not an integer multiple of num_split
. Slices
[0 : shape[split_dim] % num_split]
gets one extra dimension.
For example, if split_dim = 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] = shape = [2, 4]
[ a ]
[b c ]
output_tensor[1] = shape = [2, 3]
[ d e ]
[ ]
Args |
split_dim
|
A Tensor of type int64 .
0-D. The dimension along which to split. Must be in the range
[0, rank(shape)) .
|
indices
|
A Tensor of type int64 .
2-D tensor represents the indices of the sparse tensor.
|
values
|
A Tensor . 1-D tensor represents the values of the sparse tensor.
|
shape
|
A Tensor of type int64 .
1-D. tensor represents the shape of the sparse tensor.
output indices: A list of 1-D tensors represents the indices of the output
sparse tensors.
|
num_split
|
An int that is >= 1 . The number of ways to split.
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (output_indices, output_values, output_shape).
|
output_indices
|
A list of num_split Tensor objects with type int64 .
|
output_values
|
A list of num_split Tensor objects with the same type as values .
|
output_shape
|
A list of num_split Tensor objects with type int64 .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.SparseSplit\n\n\u003cbr /\u003e\n\nSplit a `SparseTensor` into `num_split` tensors along one dimension.\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.raw_ops.SparseSplit`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/SparseSplit)\n\n\u003cbr /\u003e\n\n tf.raw_ops.SparseSplit(\n split_dim, indices, values, shape, num_split, name=None\n )\n\nIf the `shape[split_dim]` is not an integer multiple of `num_split`. Slices\n`[0 : shape[split_dim] % num_split]` gets one extra dimension.\nFor example, if `split_dim = 1` and `num_split = 2` and the input 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] = shape = [2, 4]\n [ a ]\n [b c ]\n\n output_tensor[1] = shape = [2, 3]\n [ d e ]\n [ ]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `split_dim` | A `Tensor` of type `int64`. 0-D. The dimension along which to split. Must be in the range `[0, rank(shape))`. |\n| `indices` | A `Tensor` of type `int64`. 2-D tensor represents the indices of the sparse tensor. |\n| `values` | A `Tensor`. 1-D tensor represents the values of the sparse tensor. |\n| `shape` | A `Tensor` of type `int64`. 1-D. tensor represents the shape of the sparse tensor. output indices: A list of 1-D tensors represents the indices of the output sparse tensors. |\n| `num_split` | An `int` that is `\u003e= 1`. The number of ways to split. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|------------------|------------------------------------------------------------------------|\n| A tuple of `Tensor` objects (output_indices, output_values, output_shape). ||\n| `output_indices` | A list of `num_split` `Tensor` objects with type `int64`. |\n| `output_values` | A list of `num_split` `Tensor` objects with the same type as `values`. |\n| `output_shape` | A list of `num_split` `Tensor` objects with type `int64`. |\n\n\u003cbr /\u003e"]]