컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 문자열SplitV2
#include <string_ops.h>
sep
기반으로 source
요소를 SparseTensor
로 분할합니다.
요약
N을 소스의 크기로 설정합니다. 일반적으로 N은 배치 크기입니다. sep
기반으로 source
의 각 요소를 분할하고 분할 토큰이 포함된 SparseTensor
반환합니다. 빈 토큰은 무시됩니다.
예를 들어 N = 2이고 source[0]은 'hello world'이고 source[1]은 'ab c'이므로 출력은 다음과 같습니다.
st.indices = [0, 0;
0, 1;
1, 0;
1, 1;
1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']
sep
주어지면 연속 구분 기호는 함께 그룹화되지 않으며 빈 문자열을 구분하는 것으로 간주됩니다. 예를 들어, "1\<\>2\<\>\<\>3"
의 소스와 "\<\>"
의 sep는 ["1", "2", "", "3"]
을 반환합니다. sep
가 None이거나 빈 문자열인 경우 연속 공백은 단일 구분 기호로 간주되며 문자열에 선행 또는 후행 공백이 있는 경우 결과에는 시작자 끝에 빈 문자열이 포함되지 않습니다.
위에서 언급한 동작은 Python의 str.split과 일치합니다.
인수:
선택적 속성( Attrs
참조):
- maxsplit:
int
. maxsplit > 0
이면 결과 분할이 제한됩니다.
보고:
공개 속성
공공 기능
공개 정적 함수
맥스스플릿
Attrs Maxsplit(
int64 x
)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# tensorflow::ops::StringSplitV2 Class Reference\n\ntensorflow::ops::StringSplitV2\n==============================\n\n`#include \u003cstring_ops.h\u003e`\n\nSplit elements of `source` based on `sep` 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 `source` based on `sep` and return a `SparseTensor` containing the split tokens. [Empty](/versions/r1.15/api_docs/cc/class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty) tokens are ignored.\n\nFor example, N = 2, source\\[0\\] is 'hello world' and source\\[1\\] is 'a b c', then the output will be \n\n```text\nst.indices = [0, 0;\n 0, 1;\n 1, 0;\n 1, 1;\n 1, 2]\nst.shape = [2, 3]\nst.values = ['hello', 'world', 'a', 'b', 'c']\n```\n\n\u003cbr /\u003e\n\nIf `sep` is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings. For example, source of `\"1\\\u003c\\\u003e2\\\u003c\\\u003e\\\u003c\\\u003e3\"` and sep of `\"\\\u003c\\\u003e\"` returns `[\"1\", \"2\", \"\", \"3\"]`. If `sep` is None or an empty string, consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the startor end if the string has leading or trailing whitespace.\n\nNote that the above mentioned behavior matches python's str.split.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: `1-D` string [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), the strings to split.\n- sep: `0-D` string [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), the delimiter character.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs)):\n\n- maxsplit: An `int`. If `maxsplit \u003e 0`, limit of the split of the result.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) indices\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) values\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) shape\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [StringSplitV2](#classtensorflow_1_1ops_1_1_string_split_v2_1acbea51cb12f95ef6cae1972ae134e7ac)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sep)` ||\n| [StringSplitV2](#classtensorflow_1_1ops_1_1_string_split_v2_1a63b63775de3ac1b5830b860233d56cbc)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sep, const `[StringSplitV2::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [indices](#classtensorflow_1_1ops_1_1_string_split_v2_1afd84236fdcaab70d550ed4c31069c70b) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_string_split_v2_1a58af1d625de74aabfd6fbf24fc8f5000) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [shape](#classtensorflow_1_1ops_1_1_string_split_v2_1af40d55ff0d2df1679c54c1d41e13dccf) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [values](#classtensorflow_1_1ops_1_1_string_split_v2_1a06c7c35d77269fee3efbc2f4a6987c30) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| [Maxsplit](#classtensorflow_1_1ops_1_1_string_split_v2_1a33e93526de570b25c067a8a35545e5b2)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::StringSplitV2::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-split-v2/attrs) | Optional attribute setters for [StringSplitV2](/versions/r1.15/api_docs/cc/class/tensorflow/ops/string-split-v2#classtensorflow_1_1ops_1_1_string_split_v2). |\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### StringSplitV2\n\n```gdscript\n StringSplitV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input sep\n)\n``` \n\n### StringSplitV2\n\n```gdscript\n StringSplitV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input sep,\n const StringSplitV2::Attrs & attrs\n)\n``` \n\nPublic static functions\n-----------------------\n\n### Maxsplit\n\n```text\nAttrs Maxsplit(\n int64 x\n)\n```"]]