텐서플로우::ops::StringSplit
#include <string_ops.h> delimiter 기준으로 input 요소들을 분할하여 SparseTensor 생성합니다.
요약
소스 데이터의 크기를 N이라고 합시다(일반적으로 N은 배치 크기입니다). delimiter 기준으로 input 의 각 요소를 분할하고 분할된 토큰을 포함하는 SparseTensor 를 반환합니다. 빈 토큰은 무시됩니다.
delimiter 비어 있거나 분할 가능한 문자열일 수 있습니다. delimiter 빈 문자열인 경우, input 의 각 요소는 UTF-8 멀티바이트 시퀀스를 포함하여 개별 단일 바이트 문자열로 분할됩니다. 그렇지 않으면 delimiter 의 모든 문자가 잠재적인 분할 지점이 됩니다.
예를 들어, N=2이고 입력[0]이 'hello world'이고 입력[1]이 'ab c'인 경우 출력은 다음과 같습니다.
인덱스 = [0, 0; 0, 1; 1, 0; 1, 1; 1, 2] 모양 = [2, 3] 값 = ['hello', 'world', 'a', 'b', 'c']
논거:
- 범위: Scope 객체
- 입력: 1차원. 분할할 문자열.
- 구분자: 0-D. 구분자 문자(바이트) 또는 빈 문자열.
선택적 속성( Attrs 참조):
- skip_empty:
bool.True인 경우 결과에서 빈 문자열을 건너뜁니다.
보고:
-
Output인덱스: 희소 텐서의 인덱스를 나타내는 int64 형식의 밀집 행렬입니다. -
Output값: 분할된 값에 해당하는 문자열 벡터입니다. -
Output형태: 희소 텐서의 형태를 나타내는 길이 2의 int64 벡터이며, 첫 번째 값은 N이고 두 번째 값은 단일 입력 항목에 포함될 수 있는 최대 토큰 수입니다.
생성자와 소멸자 | |
|---|---|
StringSplit (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input delimiter) | |
StringSplit (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input delimiter, const StringSplit::Attrs & attrs) |
공개 속성 | |
|---|---|
indices | |
operation | |
shape | |
values | |
공개 정적 함수 | |
|---|---|
SkipEmpty (bool x) | |
구조 | |
|---|---|
| 텐서플로우:: ops:: StringSplit:: Attrs | StringSplit 에 대한 선택적 속성 설정기입니다. |
공개 속성
지수
::tensorflow::Output indices
작업
Operation operation
모양
::tensorflow::Output shape
값
::tensorflow::Output values
공공 기능
문자열 분할
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter )
문자열 분할
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter, const StringSplit::Attrs & attrs )
공개 정적 함수
스킵엠티
Attrs SkipEmpty( bool x )