tensorflow::ops::StringLength

#include <string_ops.h>

أطوال السلاسل النصية input .

ملخص

يحسب طول كل سلسلة نصية معطاة في موتر الإدخال.

strings = tf.constant(['Hello','TensorFlow', '']) tf.strings.length(strings).numpy() # القيمة الافتراضية هي عدد البايتات array([ 5, 10, 4], dtype=int32) tf.strings.length(strings, unit="UTF8_CHAR").numpy() array([ 5, 10, 1], dtype=int32)

الحجج:

  • النطاق: كائن النطاق
  • المدخلات: السلاسل النصية التي سيتم حساب طول كل عنصر منها.

السمات الاختيارية (انظر Attrs ):

  • الوحدة: هي الوحدة المستخدمة لحساب طول السلسلة النصية. وهي إما "BYTE" (لعدد البايتات في كل سلسلة نصية) أو "UTF8_CHAR" (لعدد نقاط ترميز يونيكود المشفرة بنظام UTF-8 في كل سلسلة نصية). تكون النتائج غير محددة إذا unit=UTF8_CHAR ولم تحتوي السلاسل النصية input على ترميز UTF-8 صالح بنيويًا.

المرتجعات:

  • Output : موتر عددي صحيح له نفس شكل input . يحتوي الناتج على أطوال السلاسل النصية input عنصرًا عنصرًا.

البناة والمدمرون

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

السمات العامة

operation
output

الوظائف العامة

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

الدوال الثابتة العامة

Unit (StringPiece x)

الهياكل

tensorflow:: ops:: StringLength:: Attrs

مُعدِّلات السمات الاختيارية لـ StringLength .

السمات العامة

عملية

Operation operation

المخرجات

::tensorflow::Output output

الوظائف العامة

طول السلسلة

 StringLength(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input
)

طول السلسلة

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

العقدة

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

الدوال الثابتة العامة

وحدة

Attrs Unit(
  StringPiece x
)