tensorflow :: ops :: StringLength
#include <string_ops.h>
Panjang string input
.
Ringkasan
Menghitung panjang setiap string yang diberikan dalam tensor input.
strings = tf.constant (['Hello', 'TensorFlow', '']) tf.strings.length (strings) .numpy () # default jumlah byte array ([5, 10, 4], dtype = int32) tf .strings.length (strings, unit = "UTF8_CHAR"). larik numpy () ([5, 10, 1], dtype = int32)
Argumen:
- scope: Objek Scope
- input: String yang digunakan untuk menghitung panjang setiap elemen.
Atribut opsional (lihat Attrs
):
- unit: Satuan yang dihitung untuk menghitung panjang string. Salah satu dari:
"BYTE"
(untuk jumlah byte di setiap string) atau"UTF8_CHAR"
(untuk jumlah poin kode Unicode"UTF8_CHAR"
UTF-8 di setiap string). Hasil tidak ditentukan jikaunit=UTF8_CHAR
dan stringinput
tidak berisi UTF-8 yang secara struktural valid.
Pengembalian:
-
Output
: Tensor integer yang bentuknya sama denganinput
. Outputnya berisi panjanginput
dengan elemen string.
Pembuat dan Penghancur | |
---|---|
StringLength (const :: tensorflow::Scope & scope, :: tensorflow::Input input) | |
StringLength (const :: tensorflow::Scope & scope, :: tensorflow::Input input, const StringLength::Attrs & attrs) |
Atribut publik | |
---|---|
operation | |
output |
Fungsi publik | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Fungsi statis publik | |
---|---|
Unit (StringPiece x) |
Structs | |
---|---|
tensorflow :: ops :: StringLength :: Attrs | Penyetel atribut opsional untuk StringLength . |
Atribut publik
operasi
Operation operation
keluaran
::tensorflow::Output output
Fungsi publik
StringLength
StringLength( const ::tensorflow::Scope & scope, ::tensorflow::Input input )
StringLength
StringLength( const ::tensorflow::Scope & scope, ::tensorflow::Input input, const StringLength::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Keluaran
operator::tensorflow::Output() const
Fungsi statis publik
Satuan
Attrs Unit( StringPiece x )