StringSplit#
Domain:
ai.onnxSince version: 20
StringSplit splits a string tensor’s elements into substrings based on a delimiter attribute and a maxsplit attribute.
The first output of this operator is a tensor of strings representing the substrings from splitting each input string on the delimiter substring. This tensor has one additional rank compared to the input tensor in order to store the substrings for each input element (where the input tensor is not empty). Note that, in order to ensure the same number of elements are present in the final dimension, this tensor will pad empty strings as illustrated in the examples below. Consecutive delimiters are not grouped together and are deemed to delimit empty strings, except if the delimiter is unspecified or is the empty string (“”). In the case where the delimiter is unspecified or the empty string, consecutive whitespace characters are regarded as a single separator and leading or trailing whitespace is removed in the output.
The second output tensor represents the number of substrings generated. maxsplit can be used to limit the number of splits performed - after the maxsplitth split if the string is not fully split, the trailing suffix of input string after the final split point is also added. For elements where fewer splits are possible than specified in maxsplit, it has no effect.
Inputs
X (T1): Tensor of strings to split.
Outputs
Y (T2): Tensor of substrings representing the outcome of splitting the strings in the input on the delimiter. Note that to ensure the same number of elements are present in the final rank, this tensor will pad any necessary empty strings.
Z (T3): The number of substrings generated for each input element.
Type Constraints
T1: The input must be a UTF-8 string tensor Allowed types: tensor(string).
T2: Tensor of substrings. Allowed types: tensor(string).
T3: The number of substrings generated. Allowed types: tensor(int64).