Tensorflow :: ops :: MatrixBandPart
#include <array_ops.h>
Kopieren Sie einen Tensor, der alles außerhalb eines zentralen Bandes in jeder innersten Matrix einstellt.
Zusammenfassung
bis Null.
Das band
wird berechnet wie folgt: Es sei angenommen , input
hat k
Dimensionen [I, J, K, ..., M, N]
, dann ist der Ausgang ein Tensor mit der gleichen Form in der
band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]
.
Die Anzeigefunktion
in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper)
.
Beispielsweise:
# if 'input' is [[ 0, 1, 2, 3] [-1, 0, 1, 2] [-2, -1, 0, 1] [-3, -2, -1, 0]],
tf.matrix_band_part(input, 1, -1) ==> [[ 0, 1, 2, 3] [-1, 0, 1, 2] [ 0, -1, 0, 1] [ 0, 0, -1, 0]],
tf.matrix_band_part(input, 2, 1) ==> [[ 0, 1, 0, 0] [-1, 0, 1, 0] [-2, -1, 0, 1] [ 0, -2, -1, 0]]
Nützliche Sonderfälle:
tf.matrix_band_part(input, 0, -1) ==> Upper triangular part. tf.matrix_band_part(input, -1, 0) ==> Lower triangular part. tf.matrix_band_part(input, 0, 0) ==> Diagonal.
Argumente:
- scope: Ein Scope- Objekt
- Eingabe: Rang
k
Tensor. - num_lower: 0-D-Tensor. Anzahl der zu behaltenden Subdiagonalen. Wenn negativ, das gesamte untere Dreieck beibehalten.
- num_upper: 0-D-Tensor. Anzahl der zu behaltenden Superdiagonale. Wenn negativ, behalten Sie das gesamte obere Dreieck.
Kehrt zurück:
-
Output
: Rangk
Tensor mit der gleichen Form wie Eingabe. Der extrahierte gebänderte Tensor.
Konstruktoren und Destruktoren | |
---|---|
MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper) |
Öffentliche Attribute | |
---|---|
band | |
operation |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche Attribute
Band
::tensorflow::Output band
Operation
Operation operation
Öffentliche Funktionen
MatrixBandPart
MatrixBandPart( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input num_lower, ::tensorflow::Input num_upper )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const