جریان تنسور:: عملیات:: کامسام

#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]

با تنظیم کوارگ reverse روی True ، cumsum در جهت مخالف انجام می شود:

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]

استدلال ها:

  • 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 انحصاری را انجام دهید.
  • معکوس: یک 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::خروجی

 operator::tensorflow::Output() const 

توابع استاتیک عمومی

انحصاری

Attrs Exclusive(
  bool x
)

معکوس

Attrs Reverse(
  bool x
)