نشكرك على متابعة Google I / O. عرض جميع الجلسات عند الطلب مشاهدة عند الطلب

تينسورفلو :: العمليات :: كومسوم

#include <math_ops.h>

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

ملخص

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

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]

من خلال ضبط kwarg reverse على True ، يتم تنفيذ cumsum في الاتجاه المعاكس:

tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]

هذا أكثر كفاءة من استخدام عمليات tf.reverse المنفصلة.

يمكن أيضًا الجمع بين kwargs reverse exclusive :

tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]

الحجج:

  • النطاق: كائن النطاق
  • س: 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 :: Output

 operator::tensorflow::Output() const 

وظائف ثابتة عامة

حصرية

Attrs Exclusive(
  bool x
)

يعكس

Attrs Reverse(
  bool x
)