تدفق التوتر:: العمليات:: طول السلسلة
#include <string_ops.h>
أطوال سلسلة input
.
ملخص
يحسب طول كل سلسلة معينة في موتر الإدخال.
الحجج:
- النطاق: كائن النطاق
- الإدخال: السلسلة التي سيتم حساب طولها.
السمات الاختيارية (انظر Attrs
):
- الوحدة: الوحدة التي يتم حسابها لحساب طول السلسلة. واحد من:
"BYTE"
(لعدد البايتات في كل سلسلة) أو"UTF8_CHAR"
(لعدد نقاط كود Unicode المشفرة 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
المشغل::tensorflow::الإدخال
operator::tensorflow::Input() const
المشغل::tensorflow::الإخراج
operator::tensorflow::Output() const
وظائف ثابتة العامة
وحدة
Attrs Unit( StringPiece x )
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::StringLength Class Reference\n\ntensorflow::ops::StringLength\n=============================\n\n`#include \u003cstring_ops.h\u003e`\n\nString lengths of `input`.\n\nSummary\n-------\n\nComputes the length of each string given in the input tensor.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: The string for which to compute the length.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs)):\n\n- unit: The unit that is counted to compute string length. One of: `\"BYTE\"` (for the number of bytes in each string) or `\"UTF8_CHAR\"` (for the number of UTF-8 encoded Unicode code points in each string). Results are undefined if `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid UTF-8.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Integer tensor that has the same shape as `input`. The output contains the element-wise string lengths of `input`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [StringLength](#classtensorflow_1_1ops_1_1_string_length_1a7bf80700ba30572d7c7ca2b6f850eaca)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input)` ||\n| [StringLength](#classtensorflow_1_1ops_1_1_string_length_1a1a20dc90501bbdb2e17e0b5964a8eff1)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, const `[StringLength::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_string_length_1a17a8867ada18bd6238863a038adb4072) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_string_length_1a3c952cda013f2825ee48c9cba19fa974) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_string_length_1a8958d29822235046d6f74f45f90f9ee2)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_length_1ad02392f74af341966e713678ada76cf3)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_length_1a75c524b5ff956f3f681cdebb8135460f)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](#classtensorflow_1_1ops_1_1_string_length_1af57b9def6e863b9003b3fc809a13d835)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::StringLength::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/string-length/attrs) | Optional attribute setters for [StringLength](/versions/r1.15/api_docs/cc/class/tensorflow/ops/string-length#classtensorflow_1_1ops_1_1_string_length). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### StringLength\n\n```gdscript\n StringLength(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input\n)\n``` \n\n### StringLength\n\n```gdscript\n StringLength(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const StringLength::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Unit\n\n```text\nAttrs Unit(\n StringPiece x\n)\n```"]]