تينسورفلو :: العمليات :: StringSplitV2
#include <string_ops.h>
عناصر الانقسام من source
على أساس sep
إلى SparseTensor
.
ملخص
لنفترض أن N هو حجم المصدر (عادةً ما يكون N هو حجم الدُفعة). تقسيم كل عنصر من source
على أساس sep
والعودة SparseTensor
التي تحتوي على الرموز الانقسام. يتم تجاهل الرموز الفارغة .
على سبيل المثال ، N = 2 ، المصدر [0] هو "hello world" والمصدر [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"
وفصل "\<\>"
يعرض ["1", "2", "", "3"]
. إذا كانت كلمة sep
هي بلا أو سلسلة فارغة ، فسيتم اعتبار المسافة البيضاء المتتالية بمثابة فاصل واحد ، ولن تحتوي النتيجة على سلاسل فارغة في نهاية البداية إذا كانت السلسلة تحتوي على مسافة بيضاء سابقة أو لاحقة.
لاحظ أن السلوك المذكور أعلاه يطابق str.split من Python.
الحجج:
- النطاق: كائن النطاق
- المدخلات:
1-D
stringTensor
، يتم تقسيم الأوتار. - 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 . |
السمات العامة
المؤشرات
::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 )
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.
Last updated 2020-04-20 UTC.