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 :: DağılımNdUpdate

#include <state_ops.h>

Belirli bir içindeki tek tek değerlere veya dilimlere seyrek updates uygular.

Özet

indices göre değişken.

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

indices tamsayı tensör olmalı ve ref indices içermelidir. 0 < K <= P \([d_0, ..., d_{Q-2}, K]\) şeklinde olmalıdır.

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, 4 dağınık öğeyi bir rank-1 tensörüne 8 öğeye güncellemek istediğimizi varsayalım. Python'da bu güncelleme şöyle görünecektir:

    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])
    update = tf.scatter_nd_update(ref, indices, updates)
    with tf.Session() as sess:
      print sess.run(update)

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

[1, 11, 3, 10, 9, 6, 7, 12]

Dilimlere güncelleme yapma hakkında daha fazla ayrıntı için tf.scatter_nd bakın.

Ayrıca bkz. tf.scatter_update ve tf.batch_scatter_update .

Argümanlar:

  • kapsam: Bir Scope nesnesi
  • ref: Değişken bir Tensör . Değişken düğümden olmalıdır.
  • indeksler: 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 güncellenmiş değerlerin tensörü.

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

  • use_locking: İsteğe bağlı bir bool. Varsayılanlar Doğru'dur. True ise, atama bir kilitle korunacaktır; aksi takdirde davranış tanımsızdır, ancak daha az çekişme gösterebilir.

İadeler:

  • Output : ref ile aynı. Güncelleme yapıldıktan sonra güncellenmiş değerleri kullanmak isteyen işlemler için kolaylık sağlamak amacıyla geri döndü.

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

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

Genel özellikler

operation
output_ref

Kamusal işlevler

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

Genel statik işlevler

UseLocking (bool x)

Yapılar

tensorflow :: ops :: ScatterNdUpdate :: Attrs

ScatterNdUpdate için isteğe bağlı öznitelik belirleyiciler.

Genel özellikler

operasyon

Operation operation

output_ref

::tensorflow::Output output_ref

Kamusal işlevler

DağılımNdUpdate

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

DağılımNdUpdate

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

düğüm

::tensorflow::Node * node() const 

operator :: tensorflow :: Girdi

 operator::tensorflow::Input() const 

operator :: tensorflow :: Çıktı

 operator::tensorflow::Output() const 

Genel statik işlevler

KullanımKilitleme

Attrs UseLocking(
  bool x
)