#include <string_ops.h>
Split elements of input
based on delimiter
into a SparseTensor
.
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']
Arguments:
Optional attributes (see Attrs
):
bool
. If True
, skip the empty strings from the result.Returns:
Output
indices: A dense matrix of int64 representing the indices of the sparse tensor.Output
values: A vector of strings corresponding to the splited values.Output
shape: a length-2 vector of int64 representing the shape of the sparse tensor, where the first value is N and the second value is the maximum number of tokens in a single input entry. Constructors and Destructors | |
---|---|
StringSplit(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter) | |
StringSplit(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter, const StringSplit::Attrs & attrs) |
Public attributes | |
---|---|
indices | |
shape | |
values |
Public static functions | |
---|---|
SkipEmpty(bool x) |
Structs | |
---|---|
tensorflow::ops::StringSplit::Attrs | Optional attribute setters for StringSplit. |
::tensorflow::Output indices
::tensorflow::Output shape
::tensorflow::Output values
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter )
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter, const StringSplit::Attrs & attrs )
Attrs SkipEmpty( bool x )
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/string-split.html