tensorflow::ops::ResourceScatterNdAdd

#include <state_ops.h>

Bir değişkendeki tek tek değerlere veya dilimlere seyrek toplama işlemi uygular.

Özet

ref P mertebesinde bir Tensor ve indices Q mertebesinde bir Tensor .

indices , ref ait indeksleri içeren tamsayı tensörler olmalıdır. Şekli [d_0, ..., d_{Q-2}, K] olmalıdır, burada 0 < K <= P .

indices en içteki boyutu ( K uzunluğunda), ref K boyutu boyunca elemanlara ( K = P ise) veya dilimlere ( K < P ise) ait indekslere karşılık gelir.

updates Q-1+PK mertebesinde ve şu şekle sahip Tensor :

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

Örneğin, 8 elemanlı bir rank-1 tensöre 4 dağınık eleman eklemek istediğimizi varsayalım. Python'da bu ekleme şu şekilde görünür:

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

Sonuç olarak, referans dosyasında yapılacak güncelleme şu şekilde olacaktır:

[1, 13, 3, 14, 14, 6, 7, 20]

Dilimlerde nasıl güncellemeler yapılacağına dair daha fazla bilgi için tf.scatter_nd bakın.

Argümanlar:

  • kapsam: Bir Kapsam nesnesi
  • ref: Bir kaynak tanıtıcısı. VarHandleOp türünden olmalıdır.
  • İndeksler: Bir Tensor . Şu türlerden biri olmalıdır: int32, int64. ref'e indekslerin tensörü.
  • Güncellemeler: Bir Tensor . ref ile aynı türde olmalıdır. ref'e eklenecek değerlerin tensörü.

İsteğe bağlı özellikler (bkz. Attrs ):

  • use_locking: İsteğe bağlı bir boolean değer. Varsayılan değeri True'dur. True ise, atama bir kilit ile korunacaktır; aksi takdirde davranış tanımsızdır, ancak daha az çekişme gösterebilir.

İadeler:

Yapıcılar ve Yıkıcılar

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

Genel özellikler

operation

Kamusal işlevler

operator::tensorflow::Operation () const

Herkese açık statik fonksiyonlar

UseLocking (bool x)

Yapılar

tensorflow::ops::ResourceScatterNdAdd::Attrs

ResourceScatterNdAdd için isteğe bağlı öznitelik ayarlayıcıları.

Genel özellikler

operasyon

Operation operation

Kamusal işlevler

ResourceScatterNdAdd

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

ResourceScatterNdAdd

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

operatör::tensorflow::İşlem

 operator::tensorflow::Operation() const 

Herkese açık statik fonksiyonlar

KullanımKilitleme

Attrs UseLocking(
  bool x
)