テンソルフロー::作戦::散乱NDSub

#include <state_ops.h>

Variable内の個々の値またはスライスにスパース減算を適用します。

まとめ

indicesに従って指定された変数内で。

refはランクPTensorindicesはランクQTensorです。

indicesrefへのインデックスを含む整数テンソルでなければなりません。これは形状[d_0, ..., d_{Q-2}, K] ( 0 < K <= Pである必要があります。

indicesの最も内側の次元 (長さK ) は、 refK番目の次元に沿った要素 ( K = Pの場合) またはスライス ( K < Pの場合) へのインデックスに対応します。

updates次の形状を持つランクQ-1+PKTensorです。

[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]

たとえば、8 つの要素を持つランク 1 のテンソルから 4 つの散乱要素を減算するとします。 Python では、この減算は次のようになります。

ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
sub = tf.scatter_nd_sub(ref, indices, updates)
with tf.Session() as sess:
  print sess.run(sub)

ref への結果の更新は次のようになります:

[1, -9, 3, -6, -4, 6, 7, -4]

スライスを更新する方法の詳細については、 tf.scatter_ndを参照してください。

引数:

  • スコープ:スコープオブジェクト
  • 参照: 可変TensorVariableノードからのものである必要があります。
  • インデックス: Tensor 。 int32、int64 のいずれかの型である必要があります。 ref へのインデックスのテンソル。
  • 更新: Tensor 。 ref と同じ型でなければなりません。 ref から減算する更新された値のテンソル。

オプションの属性 ( Attrsを参照):

  • use_locking: オプションのブール値。デフォルトは True です。 True の場合、割り当てはロックによって保護されます。それ以外の場合、動作は未定義ですが、競合が少なくなる可能性があります。

戻り値:

  • Output : 参考文献と同じ。更新の完了後に更新された値を使用する必要がある操作の便宜として返されます。

コンストラクターとデストラクター

ScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates)
ScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterNdSub::Attrs & attrs)

パブリック属性

operation
output_ref

公共機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

UseLocking (bool x)

構造体

tensorflow:: ops:: ScatterNdSub:: Attrs

ScatterNdSubのオプションの属性セッター。

パブリック属性

手術

Operation operation

出力参照

::tensorflow::Output output_ref

公共機能

散乱NDSub

 ScatterNdSub(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates
)

散乱NDSub

 ScatterNdSub(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates,
  const ScatterNdSub::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

演算子::tensorflow::入力

 operator::tensorflow::Input() const 

演算子::tensorflow::出力

 operator::tensorflow::Output() const 

パブリック静的関数

ロックを使用する

Attrs UseLocking(
  bool x
)