tensorflow:: ops:: 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( 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
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-11-05 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-11-05 (שעון UTC)."],[],[]]