tensorflow:: אופס:: MatrixDiagPart

#include <array_ops.h>

מחזירה את החלק האלכסוני המצטבר של טנזור אצווה.

סיכום

פעולה זו מחזירה טנזור עם החלק diagonal של input המצטבר. החלק diagonal מחושב באופן הבא:

נניח input יש מידות k [I, J, K, ..., M, N] , אז הפלט הוא טנזור בדרגה k - 1 עם מידות [I, J, K, ..., min(M, N)] איפה:

diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n] .

הקלט חייב להיות לפחות מטריצה.

לדוגמה:

# '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)

טיעונים:

  • scope: אובייקט Scope
  • קלט: דירוג k tensor כאשר k >= 2 .

החזרות:

  • Output : האלכסונים המחולצים בעלי צורה diagonal.shape = input.shape[:-2] + [min(input.shape[-2:])] .

בנאים והורסים

MatrixDiagPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input)

תכונות ציבוריות

diagonal
operation

תפקידים ציבוריים

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

תכונות ציבוריות

אֲלַכסוֹנִי

::tensorflow::Output diagonal

מבצע

Operation operation

תפקידים ציבוריים

MatrixDiagPart

 MatrixDiagPart(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input
)

צוֹמֶת

::tensorflow::Node * node() const 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const