Google I/O'yu ayarladığınız için teşekkür ederiz. İsteğe bağlı olarak tüm oturumları görüntüleyin İsteğe bağlı olarak izleyin

tensorflow :: ops :: ResourceScatterNdAdd

#include <state_ops.h>

Bir Değişkendeki tek tek değerlere veya dilimlere seyrek ekleme uygular .

Özet

ref , Tensor P sahip bir Tensor ve indices , Q Tensor .

indices tamsayı tensör olmalı ve ref indices içermelidir. Şekil [d_0, ..., d_{Q-2}, K] burada 0 < K <= P

En iç boyutu indices (uzunluk ile K elemanları içine endekse karşılık gelen) (eğer K = P ) ya da dilim (eğer K < P birlikte) K th boyutu ref .

updates olan Tensor seviye arasında Q-1+PK şekli ile:

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

Örneğin, bir rank-1 tensörüne 8 elemente 4 saçılmış öğe eklemek istediğimizi varsayalım. Python'da bu ekleme şöyle görünecektir:

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)

Ref için ortaya çıkan güncelleme şu şekilde görünecektir:

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

Dilimlerde nasıl güncelleme yapılacağı hakkında daha fazla ayrıntı için tf.scatter_nd konusuna bakın.

Argümanlar:

  • kapsam: Bir Scope nesnesi
  • ref: Bir kaynak tanıtıcısı. Bir VarHandleOp'dan olmalıdır.
  • indisler: Bir Tensör . Şu türlerden biri olmalıdır: int32, int64. Ref içine indekslerin tensörü.
  • güncellemeler: Bir Tensör . Ref ile aynı türe sahip olmalıdır. Ref'e eklenecek değerler tensörü.

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

  • use_locking: İsteğe bağlı bir bool. Varsayılan Doğru. True ise, atama bir kilitle 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

Genel statik işlevler

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
)

operator :: tensorflow :: İşlem

 operator::tensorflow::Operation() const 

Genel statik işlevler

KullanımKilitleme

Attrs UseLocking(
  bool x
)