tensorflow:: ops:: Cumsum

#include <math_ops.h>

احسب المجموع التراكمي للموتر x على طول axis .

ملخص

بشكل افتراضي، تقوم هذه العملية بإجراء عملية جمع تراكمي شاملة، مما يعني أن العنصر الأول من المدخلات مطابق للعنصر الأول من المخرجات:

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]

عن طريق ضبط الوسيط reverse على True ، يتم تنفيذ عملية الجمع التراكمي في الاتجاه المعاكس:

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 ، فقم بتنفيذ المجموع التراكمي الحصري.
  • عكس: 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 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

الدوال الثابتة العامة

حصري

Attrs Exclusive(
  bool x
)

يعكس

Attrs Reverse(
  bool x
)