تدفق التوتر:: العمليات:: 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)
الحجج:
- النطاق: كائن النطاق
- الإدخال: موتر الرتبة
k
حيثk >= 2
.
العوائد:
-
Output
: الأقطار المستخرجة ذات الشكلdiagonal.shape = input.shape[:-2] + [min(input.shape[-2:])]
.
البنائين والمدمرين | |
---|---|
MatrixDiagPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input) |
الوظائف العامة | |
---|---|
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