@Operator public final class StringSplit extends PrimitiveOp
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']
| Modifier and Type | Class and Description |
|---|---|
static class |
StringSplit.Options
Optional attributes for
StringSplit |
operation| Modifier and Type | Method and Description |
|---|---|
static StringSplit |
create(Scope scope,
Operand<String> input,
Operand<String> delimiter,
StringSplit.Options... options)
Factory method to create a class to wrap a new StringSplit operation to the graph.
|
Output<Long> |
indices()
A dense matrix of int64 representing the indices of the sparse tensor.
|
Output<Long> |
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.
|
static StringSplit.Options |
skipEmpty(Boolean skipEmpty) |
Output<String> |
values()
A vector of strings corresponding to the splited values.
|
equals, hashCode, toStringpublic static StringSplit create(Scope scope, Operand<String> input, Operand<String> delimiter, StringSplit.Options... options)
scope - current graph scopeinput - 1-D. Strings to split.delimiter - 0-D. Delimiter characters (bytes), or empty string.options - carries optional attributes valuespublic static StringSplit.Options skipEmpty(Boolean skipEmpty)
skipEmpty - A `bool`. If `True`, skip the empty strings from the result.public Output<Long> indices()
Copyright © 2015–2019. All rights reserved.