tensorflow:: אופס:: כמוסום
#include <math_ops.h>
חשב את הסכום המצטבר של הטנזור x
לאורך axis
.
תַקצִיר
כברירת מחדל, אופציה זו מבצעת cumsum כולל, מה שאומר שהאלמנט הראשון של הקלט זהה לאלמנט הראשון של הפלט:
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
על ידי הגדרת ה-kwarg exclusive
ל- True
, מבצעים במקום זאת הצטיינות בלעדית:
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
על ידי הגדרת ה-kwarg reverse
ל- True
, ה-cumsum מתבצע בכיוון ההפוך:
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
זה יעיל יותר משימוש ב- tf.reverse
ops נפרד.
ניתן לשלב גם את הקווארגים reverse
exclusive
:
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
טיעונים:
- scope: אובייקט Scope
- 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 בלעדי. - הפוך: A
bool
(ברירת מחדל: False).
החזרות:
-
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) |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
מבנים | |
---|---|
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
)