tensorflow:: ops:: StringSplitV2
#include <string_ops.h> sourceの要素をsepに基づいてSparseTensorに分割します。
まとめ
ソースのサイズをNとします(通常、Nはバッチサイズになります)。 sourceの各要素をsepに基づいて分割し、分割されたトークンを含む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が指定されている場合、連続する区切り文字はグループ化されず、空文字列の区切り文字とsepれます。たとえば、ソースが"1\<\>2\<\>\<\>3" 、sep が"\<\>"の場合["1", "2", "", "3"]が返されます。sep が None または空文字列の場合、連続する空白文字は単一の区切り文字とみなされ、文字列の先頭または末尾に空白文字がある場合、結果には開始または末尾に空文字列は含まれません。
上記の動作は、Pythonのstr.splitの動作と一致することに注意してください。
議論:
オプション属性( Attrs参照):
- maxsplit:
int。maxsplitmaxsplit > 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のオプション属性セッター。 |
公開属性
指数
::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 )
パブリック静的関数
マックススプリット
Attrs Maxsplit( int64 x )