tensorflow::ops::Cumsum

#include <math_ops.h>

Вычислите кумулятивную сумму тензора x вдоль axis .

Краткое содержание

По умолчанию эта операция выполняет суммирование с учетом всех элементов, что означает, что первый элемент входных данных идентичен первому элементу выходных данных:

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

Установив аргумент exclusive в True , вместо этого будет выполнена эксклюзивная проверка контрольной суммы:

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 .
  • axis: Tensor типа int32 (по умолчанию: 0). Должен находиться в диапазоне [-rank(x), rank(x)) .

Дополнительные атрибуты (см. Attrs ):

  • exclusive: Если True , выполнить исключающее суммирование.
  • reverse: 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::Input

 operator::tensorflow::Input() const 

оператор::tensorflow::Output

 operator::tensorflow::Output() const 

Открытые статические функции

Эксклюзив

Attrs Exclusive(
  bool x
)

Обеспечить регресс

Attrs Reverse(
  bool x
)