Google I/O에 참여해 주셔서 감사합니다. 주문형 모든 세션 보기 주문형 시청

tensorflow :: ops :: StringSplitV2

#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 가 제공되면 연속 구분 기호가 함께 그룹화되지 않고 빈 문자열을 구분하는 것으로 간주됩니다. 예를 들어 source of "1\<\>2\<\>\<\>3" 및 sep of "\<\>"["1", "2", "", "3"] 반환합니다. sep 가 None이거나 빈 문자열이면 연속 된 공백은 단일 구분자로 간주되며 문자열에 선행 또는 후행 공백이 있으면 결과의 시작 끝에 빈 문자열이 포함되지 않습니다.

위에서 언급 한 동작은 파이썬의 str.split과 일치합니다.

인수 :

  • 범위 : 범위 개체
  • 입력 : 1-D 문자열 Tensor , 분할 할 문자열.
  • sep : 0-D 문자열 Tensor , 구분 문자.

선택적 속성 ( Attrs 참조) :

  • maxsplit : int . maxsplit > 0 이면 결과 분할 제한입니다.

보고:

생성자와 소멸자

StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep)
StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep, const StringSplitV2::Attrs & attrs)

공용 속성

indices
operation
shape
values

공개 정적 함수

Maxsplit (int64 x)

구조체

tensorflow :: ops :: StringSplitV2 :: Attrs

StringSplitV2에 대한 선택적 속성 setter입니다.

공용 속성

지수

::tensorflow::Output indices

조작

Operation operation

모양

::tensorflow::Output shape

가치

::tensorflow::Output values

공공 기능

StringSplitV2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep
)

StringSplitV2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep,
  const StringSplitV2::Attrs & attrs
)

공개 정적 함수

Maxsplit

Attrs Maxsplit(
  int64 x
)