tensorflow :: opérations :: MatrixDiag
#include <array_ops.h>
Renvoie un tenseur diagonal groupé avec des valeurs diagonales groupées données.
Résumé
Étant donné une diagonal
, cette opération retourne un tenseur avec la diagonal
et tout le reste complété par des zéros. La diagonale est calculée comme suit:
Supposons que la diagonal
a k
dimensions [I, J, K, ..., N]
, alors la sortie est un tenseur de rang k+1
de dimensions [I, J, K, ..., N, N] `où:
output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]
.
Par example:
# '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)
Arguments:
- scope: un objet Scope
- diagonale: Rang
k
, oùk >= 1
.
Retour:
-
Output
: Rangk+1
, avecoutput.shape = diagonal.shape + [diagonal.shape[-1]]
.
Constructeurs et destructeurs | |
---|---|
MatrixDiag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal) |
Attributs publics | |
---|---|
operation | |
output |
Fonctions publiques | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Attributs publics
opération
Operation operation
production
::tensorflow::Output output
Fonctions publiques
MatrixDiag
MatrixDiag( const ::tensorflow::Scope & scope, ::tensorflow::Input diagonal )
nœud
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const