tensoreflusso:: ops:: StringLength
#include <string_ops.h> Lunghezze delle stringhe di input .
Riepilogo
Calcola la lunghezza di ogni stringa fornita nel tensore di input.
strings = tf.constant(['Hello','TensorFlow', '']) tf.strings.length(strings).numpy() # default conta byte array([ 5, 10, 4], dtype=int32) tf .strings.length(strings, unit="UTF8_CHAR").numpy() array([ 5, 10, 1], dtype=int32)
Argomenti:
- scope: un oggetto Scope
- input: le stringhe di cui calcolare la lunghezza per ciascun elemento.
Attributi facoltativi (vedi Attrs ):
- unità: l'unità conteggiata per calcolare la lunghezza della stringa. Uno tra:
"BYTE"(per il numero di byte in ciascuna stringa) o"UTF8_CHAR"(per il numero di punti di codice Unicode codificati UTF-8 in ciascuna stringa). I risultati non sono definiti seunit=UTF8_CHARe le stringheinputnon contengono UTF-8 strutturalmente valido.
Resi:
-
Output: tensore intero che ha la stessa formainput. L'output contiene la lunghezza della stringa per elemento diinput.
Costruttori e distruttori | |
|---|---|
StringLength (const :: tensorflow::Scope & scope, :: tensorflow::Input input) | |
StringLength (const :: tensorflow::Scope & scope, :: tensorflow::Input input, const StringLength::Attrs & attrs) |
Attributi pubblici | |
|---|---|
operation | |
output | |
Funzioni pubbliche | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Funzioni pubbliche statiche | |
|---|---|
Unit (StringPiece x) | |
Strutture | |
|---|---|
| tensorflow:: ops:: StringLength:: Attrs | Setter di attributi facoltativi per StringLength . |
Attributi pubblici
operazione
Operation operation
produzione
::tensorflow::Output output
Funzioni pubbliche
StringLength
StringLength( const ::tensorflow::Scope & scope, ::tensorflow::Input input )
StringLength
StringLength( const ::tensorflow::Scope & scope, ::tensorflow::Input input, const StringLength::Attrs & attrs )
nodo
::tensorflow::Node * node() const
operatore::tensorflow::Input
operator::tensorflow::Input() const
operatore::tensorflow::Output
operator::tensorflow::Output() const
Funzioni pubbliche statiche
Unità
Attrs Unit( StringPiece x )