تينسورفلو :: العمليات :: StringSplit
#include <string_ops.h>
تقسيم عناصر input
على أساس delimiter
في SparseTensor
.
ملخص
لنفترض أن N هو حجم المصدر (عادةً ما يكون N هو حجم الدُفعة). قم SparseTensor
كل عنصر من عناصر input
بناءً على delimiter
وإرجاع SparseTensor
يحتوي على الرموز المميزة 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']
الحجج:
- النطاق: كائن النطاق
- الإدخال: 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) |
الهياكل | |
---|---|
tensorflow :: ops :: StringSplit :: Attrs | محددات السمات الاختيارية لـ StringSplit . |
السمات العامة
المؤشرات
::tensorflow::Output indices
عملية
Operation operation
شكل
::tensorflow::Output shape
القيم
::tensorflow::Output values
الوظائف العامة
StringSplit
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter )
StringSplit
StringSplit( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input delimiter, const StringSplit::Attrs & attrs )
وظائف ثابتة عامة
تخطي فارغ
Attrs SkipEmpty( bool 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.