Split elements of `source` based on `sep` into a `SparseTensor`.
Let N be the size of source (typically N will be the batch size). Split each element of `source` based on `sep` and return a `SparseTensor` containing the split tokens. Empty tokens are ignored.
For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', then the output will be
st.indices = [0, 0;
0, 1;
1, 0;
1, 1;
1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']
Note that the above mentioned behavior matches python's str.split.
Nested Classes
class | StringSplit.Options | Optional attributes for StringSplit
|
Constants
String | OP_NAME | The name of this op, as known by TensorFlow core engine |
Public Methods
static StringSplit | |
Output<TInt64> |
indices()
|
static StringSplit.Options |
maxsplit(Long maxsplit)
|
Output<TInt64> |
shape()
|
Output<TString> |
values()
|
Inherited Methods
Constants
public static final String OP_NAME
The name of this op, as known by TensorFlow core engine
Public Methods
public static StringSplit create (Scope scope, Operand<TString> input, Operand<TString> sep, Options... options)
Factory method to create a class wrapping a new StringSplit operation.
Parameters
scope | current scope |
---|---|
input | `1-D` string `Tensor`, the strings to split. |
sep | `0-D` string `Tensor`, the delimiter character. |
options | carries optional attributes values |
Returns
- a new instance of StringSplit
public static StringSplit.Options maxsplit (Long maxsplit)
Parameters
maxsplit | An `int`. If `maxsplit > 0`, limit of the split of the result. |
---|