tensorflow::ops::MatrixDiag
#include <array_ops.h>Renvoie un tenseur diagonal par lots avec des valeurs diagonales par lots données.
Résumé
Étant donné une diagonal , cette opération renvoie un tenseur dont la diagonal est complétée par des zéros. La diagonale est calculée comme suit :
Supposons que diagonal ait k dimensions [I, J, K, ..., N] , alors la sortie est un tenseur de rang k+1 avec des dimensions [I, J, K, ..., N, N]` où :
output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n] .
Par exemple:
# '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 :
- portée : un objet Scope
- diagonale : Rang
k, oùk >= 1.
Retours :
-
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
sortir
::tensorflow::Output output
fonctions publiques
MatrixDiag
MatrixDiag( const ::tensorflow::Scope & scope, ::tensorflow::Input diagonal )
nœud
::tensorflow::Node * node() const
opérateur::tensorflow::Entrée
operator::tensorflow::Input() const
opérateur::tensorflow::Sortie
operator::tensorflow::Output() const