Tensorflow :: ops :: MatrixDiag
#include <array_ops.h>
Gibt einen gestapelten Diagonaltensor mit bestimmten gestapelten Diagonalwerten zurück.
Zusammenfassung
Bei einer gegebenen diagonal
gibt diese Operation einen Tensor mit der diagonal
und alles andere mit Nullen aufgefüllt zurück. Die Diagonale wird wie folgt berechnet:
Angenommen, die diagonal
hat k
Dimensionen [I, J, K, ..., N]
, dann ist die Ausgabe ein Tensor vom Rang k+1
mit den Dimensionen [I, J, K, ..., N, N] `wobei:
output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]
.
Beispielsweise:
# '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)
Argumente:
- scope: Ein Scope- Objekt
- Diagonale: Rang
k
, wobeik >= 1
.
Kehrt zurück:
-
Output
: Rangk+1
, mitoutput.shape = diagonal.shape + [diagonal.shape[-1]]
.
Konstruktoren und Destruktoren | |
---|---|
MatrixDiag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal) |
Öffentliche Attribute | |
---|---|
operation | |
output |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche Attribute
Operation
Operation operation
Ausgabe
::tensorflow::Output output
Öffentliche Funktionen
MatrixDiag
MatrixDiag( const ::tensorflow::Scope & scope, ::tensorflow::Input diagonal )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const