tensorflow:: אופס:: DynamicPartition
#include <data_flow_ops.h>
מחלק data
לטנזורים num_partitions
באמצעות מדדים partitions
.
סיכום
עבור כל אינדקס tuple js
בגודל partitions.ndim
, data[js, ...]
הופכים לחלק מהפלטים outputs[partitions[js]]
. הפרוסות עם partitions[js] = i
ממוקמות outputs[i]
בסדר לקסיקוגרפי של js
, והממד הראשון של outputs[i]
הוא מספר הערכים partitions
השווה ל- i
. בפירוט,
outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
data.shape
חייב להתחיל עם partitions.shape
.
לדוגמה:
# Scalar partitions. partitions = 1 num_partitions = 2 data = [10, 20] outputs[0] = [] # Empty with shape [0, 2] outputs[1] = [[10, 20]]
# Vector partitions. partitions = [0, 0, 1, 1, 0] num_partitions = 2 data = [10, 20, 30, 40, 50] outputs[0] = [10, 20, 50] outputs[1] = [30, 40]
ראה dynamic_stitch
לדוגמא כיצד למזג מחיצות בחזרה.
טיעונים:
- scope: אובייקט Scope
- מחיצות: כל צורה. מדדים בטווח
[0, num_partitions)
. - num_partitions: מספר המחיצות לפלט.
החזרות:
-
OutputList
: טנסור הפלטים.
בנאים והורסים | |
---|---|
DynamicPartition (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input partitions, int64 num_partitions) |
תכונות ציבוריות | |
---|---|
operation | |
outputs |
תפקידים ציבוריים | |
---|---|
operator[] (size_t index) const |
תכונות ציבוריות
מבצע
Operation operation
תפוקות
::tensorflow::OutputList outputs
תפקידים ציבוריים
DynamicPartition
DynamicPartition( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input partitions, int64 num_partitions )
מַפעִיל[]
::tensorflow::Output operator[]( size_t index ) const
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2023-12-01 (שעון UTC).
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"חסרים לי מידע או פרטים"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"התוכן מורכב מדי או עם יותר מדי שלבים"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"התוכן לא עדכני"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"בעיה בתרגום"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"בעיה בדוגמאות/בקוד"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"סיבה אחרת"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"התוכן קל להבנה"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"התוכן עזר לי לפתור בעיה"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"סיבה אחרת"
}]