tensorflow:: ops:: Cumsum

#include <math_ops.h>

axisに沿ったテンソルxの累積和を計算します。

まとめ

デフォルトでは、この演算は包括的な累積和を実行します。つまり、入力の最初の要素は出力の最初の要素と同一になります。

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に設定すると、累積和が逆方向に実行されます。

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 。
  • axis: int32型のTensor (デフォルト: 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 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

パブリック静的関数

エクスクルーシブ

Attrs Exclusive(
  bool x
)

逆行する

Attrs Reverse(
  bool x
)