Google I/O'yu ayarladığınız için teşekkür ederiz. İsteğe bağlı olarak tüm oturumları görüntüleyin İsteğe bağlı olarak izleyin

tensorflow :: ops :: IP uzunluğu

#include <string_ops.h>

input dize uzunlukları.

Özet

Giriş tensöründe verilen her dizinin uzunluğunu hesaplar.

strings = tf.constant (['Merhaba', 'TensorFlow', '']) tf.strings.length (dizeler) .numpy () # varsayılan bayt dizisini sayar ([5, 10, 4], dtype = int32) tf .strings.length (dizeler, birim = "UTF8_CHAR"). numpy () dizi ([5, 10, 1], dtype = int32)

Argümanlar:

  • kapsam: Bir Scope nesnesi
  • girdi: Her bir öğenin uzunluğunun hesaplanacağı dizeler.

İsteğe bağlı özellikler (bkz. Attrs ):

  • birim: Dize uzunluğunu hesaplamak için sayılan birim. "UTF8_CHAR" biri: "BYTE" (her dizedeki bayt sayısı için) veya "UTF8_CHAR" (her dizedeki UTF-8 kodlu Unicode kod noktalarının sayısı için). unit=UTF8_CHAR ve input dizeleri yapısal olarak geçerli UTF-8 içermiyorsa sonuçlar tanımsızdır.

İadeler:

  • Output : ile aynı şekle sahip tamsayı tensör input . Çıktı, input eleman bazlı dizgi uzunluklarını içerir.

Yapıcılar ve Yıkıcılar

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

Genel özellikler

operation
output

Kamusal işlevler

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

Genel statik işlevler

Unit (StringPiece x)

Yapılar

tensorflow :: ops :: StringLength :: Attrs

StringLength için isteğe bağlı öznitelik ayarlayıcılar.

Genel özellikler

operasyon

Operation operation

çıktı

::tensorflow::Output output

Kamusal işlevler

IP uzunluğu

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

IP uzunluğu

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

düğüm

::tensorflow::Node * node() const 

operator :: tensorflow :: Girdi

 operator::tensorflow::Input() const 

operator :: tensorflow :: Çıktı

 operator::tensorflow::Output() const 

Genel statik işlevler

Birim

Attrs Unit(
  StringPiece x
)