Split elements of input
based on delimiter
into a SparseTensor
.
tf.raw_ops.StringSplit(
input, delimiter, skip_empty=True, name=None
)
Let N be the size of source (typically N will be the batch size). Split each
element of input
based on delimiter
and return a SparseTensor
containing the splitted tokens. Empty tokens are ignored.
delimiter
can be empty, or a string of split characters. If delimiter
is an
empty string, each element of input
is split into individual single-byte
character strings, including splitting of UTF-8 multibyte sequences. Otherwise
every character of delimiter
is a potential split point.
For example | |
---|---|
N = 2, input[0] is 'hello world' and input[1] is 'a b c', then the output
will be
indices = [0, 0; 0, 1; 1, 0; 1, 1; 1, 2] shape = [2, 3] values = ['hello', 'world', 'a', 'b', 'c'] |
Returns | |
---|---|
A tuple of Tensor objects (indices, values, shape).
|
|
indices
|
A Tensor of type int64 .
|
values
|
A Tensor of type string .
|
shape
|
A Tensor of type int64 .
|