flux tensoriel : : opérations : : MatriceDiag

#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 avec la diagonal et tout le reste complété 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:

  • scope : un objet Scope
  • diagonale : Rang k , où k >= 1 .

Retour:

  • Output : Rang k+1 , avec output.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

MatriceDiag

 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