テンソルフロー::作戦::カムサム

#include <math_ops.h>

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

まとめ

デフォルトでは、この演算は包括的な合計を実行します。これは、入力の最初の要素が出力の最初の要素と同一であることを意味します。

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

exclusive kwarg をTrueに設定すると、代わりに排他的合計が実行されます。

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

reverse kwarg をTrueに設定すると、cumsum が逆方向に実行されます。

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

これは、個別のtf.reverse演算を使用するよりも効率的です。

reverseexclusiveクワーグを組み合わせることもできます。

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

引数:

  • スコープ:スコープオブジェクト
  • x: Tensor 。次の型のいずれかである必要があります: float32float64int64int32uint8uint16int16int8complex64complex128qint8quint8qint32half
  • 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 

演算子::tensorflow::入力

 operator::tensorflow::Input() const 

演算子::tensorflow::出力

 operator::tensorflow::Output() const 

パブリック静的関数

エクスクルーシブ

Attrs Exclusive(
  bool x
)

逆行する

Attrs Reverse(
  bool x
)