تدفق التوتر:: العمليات:: MatrixBandPart

#include <array_ops.h>

انسخ موترًا يضبط كل شيء خارج النطاق المركزي في كل مصفوفة أعمق.

ملخص

إلى الصفر.

يتم حساب جزء band على النحو التالي: افترض أن input له أبعاد k [I, J, K, ..., M, N] ، فإن الإخراج هو موتر بنفس الشكل حيث

band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]

وظيفة المؤشر

in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper)

على سبيل المثال:

# 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]]

حالات خاصة مفيدة:

 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.

الحجج:

  • النطاق: كائن النطاق
  • الإدخال: موتر رتبة k .
  • num_lower: موتر 0-D. عدد الأقطار الفرعية التي يجب الاحتفاظ بها. إذا كانت سلبية، احتفظ بالمثلث السفلي بأكمله.
  • num_upper: موتر 0-D. عدد الأقطار الفائقة التي يجب الاحتفاظ بها. إذا كانت سلبية، احتفظ بالمثلث العلوي بأكمله.

عائدات:

  • Output : موتر الرتبة k من نفس شكل الإدخال. الموتر النطاقات المستخرجة.

البنائين والمدمرين

MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper)

الصفات العامة

band
operation

الوظائف العامة

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

الصفات العامة

فرقة

::tensorflow::Output band

عملية

Operation operation

الوظائف العامة

MatrixBandPart

 MatrixBandPart(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input num_lower,
  ::tensorflow::Input num_upper
)

العقدة

::tensorflow::Node * node() const 

المشغل::tensorflow::الإدخال

 operator::tensorflow::Input() const 

المشغل::tensorflow::الإخراج

 operator::tensorflow::Output() const