Tensorflow :: ops :: Diag
#include <array_ops.h>
Gibt einen Diagonaltensor mit bestimmten 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 die Abmessungen [D1, ..., Dk], dann ist die Ausgabe ein Tensor vom Rang 2k mit den Abmessungen [D1, ..., Dk, D1, ..., Dk], wobei:
output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]
und 0 überall sonst.
Zum Beispiel:
# '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]]
Argumente:
- scope: Ein Scope- Objekt
- Diagonale: Rang k Tensor, wobei k höchstens 1 ist.
Kehrt zurück:
-
Output
: Der Ausgangstensor.
Konstruktoren und Destruktoren | |
---|---|
Diag (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
Diag
Diag( 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