tensor akışı:: işlem:: Teşhis

#include <array_ops.h>

Belirli bir çapraz değere sahip çapraz bir tensör döndürür.

Özet

Bir diagonal verildiğinde, bu işlem diagonal bir tensör döndürür ve diğer her şey sıfırlarla doldurulur. Köşegen şu şekilde hesaplanır:

diagonal [D1,..., Dk] boyutlarına sahip olduğunu varsayalım, bu durumda çıktı, [D1,..., Dk, D1,..., Dk] boyutlarına sahip 2k dereceli bir tensör olur; burada:

output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik] ve diğer her yerde 0.

Örneğin:

# 'diagonal' is [1, 2, 3, 4]
tf.diag(diagonal) ==> [[1, 0, 0, 0]
                       [0, 2, 0, 0]
                       [0, 0, 3, 0]
                       [0, 0, 0, 4]]

Argümanlar:

  • kapsam: Bir Kapsam nesnesi
  • diyagonal: k'nın en fazla 1 olduğu sıra k tensörü.

İadeler:

  • Output : Çıkış tensörü.

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

Diag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal)

Genel özellikler

operation
output

Kamu işlevleri

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

Genel özellikler

operasyon

Operation operation

çıktı

::tensorflow::Output output

Kamu işlevleri

Teşhis

 Diag(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input diagonal
)

düğüm

::tensorflow::Node * node() const 

operatör::tensorflow::Giriş

 operator::tensorflow::Input() const 

operatör::tensorflow::Çıktı

 operator::tensorflow::Output() const