tensorflow:: ops:: Cumsum
#include <math_ops.h> חשב את הסכום המצטבר של הטנזור x לאורך axis .
תַקצִיר
כברירת מחדל, פעולה זו מבצעת cumsum inclusive, כלומר האלמנט הראשון של הקלט זהה לאלמנט הראשון של הפלט:
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
על ידי הגדרת kwarg exclusive ל- True , מתבצע במקום זאת cumsum בלעדי:
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
על ידי הגדרת ה- reverse kwarg ל- True , ה-cumsum מתבצע בכיוון ההפוך:
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
זה יעיל יותר מאשר שימוש בפעולות tf.reverse נפרדות.
ניתן גם לשלב את הקווארגים reverse exclusive :
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
טיעונים:
- היקף: אובייקט היקף
- x:
Tensor. חייב להיות אחד מהסוגים הבאים:float32,float64,int64,int32,uint8,uint16,int16,int8,complex64,complex128,qint8,quint8,qint32,half. - ציר:
Tensorמסוגint32(ברירת מחדל: 0). חייב להיות בטווח[-rank(x), rank(x)).
מאפיינים אופציונליים (ראה Attrs ):
- בלעדי: אם
True, בצע cumsum בלעדי. - הפוך:
bool(ברירת מחדל: שקר).
החזרות:
-
Output: טנזור היציאה.
בנאים והורסים | |
|---|---|
Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis) | |
Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis, const Cumsum::Attrs & attrs) |
מאפיינים ציבוריים | |
|---|---|
operation | |
out | |
תפקידים ציבוריים | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
פונקציות סטטיות ציבוריות | |
|---|---|
Exclusive (bool x) | |
Reverse (bool x) | |
מבנים | |
|---|---|
| tensorflow:: ops:: Cumsum:: Attrs | קובעי מאפיינים אופציונליים עבור Cumsum . |
מאפיינים ציבוריים
מִבצָע
Operation operation
הַחוּצָה
::tensorflow::Output out
תפקידים ציבוריים
קומסום
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis )
קומסום
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumsum::Attrs & attrs )
צוֹמֶת
::tensorflow::Node * node() const
אופרטור::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
בִּלעָדִי
Attrs Exclusive( bool x )
לַהֲפוֹך
Attrs Reverse( bool x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-11-05 (שעון UTC).