flux tensoriel : : opérations : : MatrixDiagPart

#include <array_ops.h>

Renvoie la partie diagonale groupée d'un tenseur groupé.

Résumé

Cette opération renvoie un tenseur avec la partie diagonal de l' input groupée. 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:

  • scope : un objet Scope
  • entrée : Tenseur de rang kk >= 2 .

Retour:

  • Output : La ou les diagonales extraites ayant la forme diagonal.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