تدفق التوتر:: العمليات:: كومسوم
#include <math_ops.h>
حساب المجموع التراكمي للموتر x
على طول axis
.
ملخص
بشكل افتراضي، تؤدي هذه العملية عملية شاملة، مما يعني أن العنصر الأول من الإدخال مطابق للعنصر الأول من الإخراج:
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
، فقم بإجراء أمر حصري. - العكس:
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) |
الوظائف العامة | |
---|---|
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
)