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)

תכונות ציבוריות

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
)