tensorflow:: אופס:: MatrixDiag
#include <array_ops.h>
מחזירה טנזור אלכסוני אצווה עם ערכי אלכסון אצווה נתון.
תַקצִיר
בהינתן diagonal
, פעולה זו מחזירה טנזור עם diagonal
וכל השאר מרופד באפסים. האלכסון מחושב באופן הבא:
נניח diagonal
יש מידות k
[I, J, K, ..., N]
, אז הפלט הוא טנזור בדרגה k+1
עם מידות [I, J, K, ..., N, N]` שבו:
output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]
.
לְדוּגמָה:
# '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)
טיעונים:
- scope: אובייקט Scope
- אלכסון: דרגה
k
, כאשרk >= 1
.
החזרות:
-
Output
: דירוגk+1
, עםoutput.shape = diagonal.shape + [diagonal.shape[-1]]
.
בנאים והורסים | |
---|---|
MatrixDiag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal) |
תכונות ציבוריות | |
---|---|
operation | |
output |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
תכונות ציבוריות
מִבצָע
Operation operation
תְפוּקָה
::tensorflow::Output output
תפקידים ציבוריים
MatrixDiag
MatrixDiag( const ::tensorflow::Scope & scope, ::tensorflow::Input diagonal )
צוֹמֶת
::tensorflow::Node * node() const
מפעיל::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const