Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::StringSplit
#include <string_ops.h>
Split elements of input
based on delimiter
into a SparseTensor
.
Summary
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']
Args:
- scope: A Scope object
- input: 1-D. Strings to split.
- delimiter: 0-D. Delimiter characters (bytes), or empty string.
Optional attributes (see Attrs
):
- skip_empty: A
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.
Public attributes
Public functions
Public static functions
SkipEmpty
Attrs SkipEmpty(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::StringSplit Class Reference\n\ntensorflow::ops::StringSplit\n============================\n\n`#include \u003cstring_ops.h\u003e`\n\nSplit elements of `input` based on `delimiter` into a `SparseTensor`.\n\nSummary\n-------\n\nLet 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](/versions/r2.14/api_docs/cc/class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty) tokens are ignored.\n\n`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.\n\nFor example: N = 2, input\\[0\\] is 'hello world' and input\\[1\\] is 'a b c', then the output will be\n\nindices = \\[0, 0; 0, 1; 1, 0; 1, 1; 1, 2\\] shape = \\[2, 3\\] values = \\['hello', 'world', 'a', 'b', 'c'\\]\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: 1-D. Strings to split.\n- delimiter: 0-D. Delimiter characters (bytes), or empty string.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs)):\n\n- skip_empty: A `bool`. If `True`, skip the empty strings from the result.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) indices: A dense matrix of int64 representing the indices of the sparse tensor.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) values: A vector of strings corresponding to the splited values.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_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.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [StringSplit](#classtensorflow_1_1ops_1_1_string_split_1ab3e43561fc94bb0cf1dc324ae780b058)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` delimiter)` ||\n| [StringSplit](#classtensorflow_1_1ops_1_1_string_split_1aa084e3f7532182e407e239142972f206)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` delimiter, const `[StringSplit::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [indices](#classtensorflow_1_1ops_1_1_string_split_1ad78d9029594ea73a2d6f82864344d45d) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_string_split_1a9f13bcd1e34600b3a8b14445d59142a2) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [shape](#classtensorflow_1_1ops_1_1_string_split_1a008b2049c8b2b2c39f057bd4162dc3c2) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [values](#classtensorflow_1_1ops_1_1_string_split_1ae71dfe97b78a0999e771725948f9ab04) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [SkipEmpty](#classtensorflow_1_1ops_1_1_string_split_1af6097b372cd021e78a46d3f6076c6745)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::StringSplit::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/string-split/attrs) | Optional attribute setters for [StringSplit](/versions/r2.14/api_docs/cc/class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split). |\n\nPublic attributes\n-----------------\n\n### indices\n\n```text\n::tensorflow::Output indices\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### shape\n\n```text\n::tensorflow::Output shape\n``` \n\n### values\n\n```text\n::tensorflow::Output values\n``` \n\nPublic functions\n----------------\n\n### StringSplit\n\n```gdscript\n StringSplit(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input delimiter\n)\n``` \n\n### StringSplit\n\n```gdscript\n StringSplit(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input delimiter,\n const StringSplit::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### SkipEmpty\n\n```text\nAttrs SkipEmpty(\n bool x\n)\n```"]]