tensor akışı:: işlem:: MatrixDiag

#include <array_ops.h>

Belirli bir toplu diyagonal değerlere sahip toplu bir diyagonal 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 k boyutuna [I, J, K, ..., N] sahip olduğunu varsayalım, bu durumda çıktı, [I, J, K, ..., N, N]` boyutlarına sahip k+1 dereceli bir tensördür; burada:

output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]

Örneğin:

# 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]

and diagonal.shape = (2, 4)

tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
                                     [0, 2, 0, 0]
                                     [0, 0, 3, 0]
                                     [0, 0, 0, 4]],
                                    [[5, 0, 0, 0]
                                     [0, 6, 0, 0]
                                     [0, 0, 7, 0]
                                     [0, 0, 0, 8]]]

which has shape (2, 4, 4)

Argümanlar:

  • kapsam: Bir Kapsam nesnesi
  • diyagonal: Derece k , burada k >= 1 .

İadeler:

  • Output : Rank k+1 , output.shape = diagonal.shape + [diagonal.shape[-1]] ile.

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

MatrixDiag (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

MatrixDiag

 MatrixDiag(
  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