tensorflow::ops::Partie de diagnostic de matrice
#include <array_ops.h>Renvoie la partie diagonale par lots d'un tenseur par lots.
Résumé
Cette opération renvoie un tenseur contenant la partie diagonal des input regroupées. La partie diagonal est calculée comme suit :
Supposons que input ait k dimensions [I, J, K, ..., M, N] , alors la sortie est un tenseur de rang k - 1 avec des dimensions [I, J, K, ..., min(M, N)] où :
diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n] .
L'entrée doit être au moins une matrice.
Par exemple:
# 'input' is [[[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]]]and input.shape = (2, 4, 4)
tf.matrix_diag_part(input) ==> [[1, 2, 3, 4], [5, 6, 7, 8]]
which has shape (2, 4)
Arguments :
- portée : un objet Scope
- entrée : tenseur de rang
koùk >= 2.
Retours :
-
Output: La ou les diagonales extraites ayant la formediagonal.shape = input.shape[:-2] + [min(input.shape[-2:])].
Constructeurs et destructeurs | |
|---|---|
MatrixDiagPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input) |
attributs publics | |
|---|---|
diagonal | |
operation | |
fonctions publiques | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
attributs publics
diagonale
::tensorflow::Output diagonal
opération
Operation operation
fonctions publiques
MatrixDiagPart
MatrixDiagPart( const ::tensorflow::Scope & scope, ::tensorflow::Input input )
nœud
::tensorflow::Node * node() const
opérateur::tensorflow::Entrée
operator::tensorflow::Input() const
opérateur::tensorflow::Sortie
operator::tensorflow::Output() const