tensör akışı:: işlem:: DağılımNdGüncellemesi
#include <state_ops.h> Belirli bir değer içindeki bireysel değerlere veya dilimlere seyrek updates uygular.
Özet
indices göre değişkenlik göstermektedir.
ref , P derecesine sahip bir Tensor ve indices , Q derecesine sahip bir Tensor .
indices ref içindeki dizinleri içeren tamsayı tensör olmalıdır. Şekli olmalı \([d_0, ..., d_{Q-2}, K]\) burada 0 < K <= P .
indices en iç boyutu ( K uzunluğunda), ref K boyutu boyunca elemanlar ( K = P ise) veya dilimler ( K < P ise) şeklindeki endekslere karşılık gelir.
updates Q-1+PK dereceli Tensor ve şu şekle sahiptir:
$$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$
Örneğin, 4 dağınık öğeyi derece 1 tensöre 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)
Sonuçta ortaya çıkan ref güncellemesi şöyle görünecektir:
[1, 11, 3, 10, 9, 6, 7, 12]
Dilimlerde güncellemelerin nasıl yapılacağı 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 Kapsam nesnesi
- ref: Değişken bir Tensör . Değişken bir düğümden olmalıdır.
- endeksler: A Tensör . Aşağıdaki türlerden biri olmalıdır: int32, int64. Ref'e endekslerin tensörü.
- güncellemeler: Bir Tensör . Ref ile aynı türde olmalıdır. Referansa eklenecek güncellenmiş değerlerin tensörü.
İsteğe bağlı özellikler (bkz. Attrs ):
- use_locking: İsteğe bağlı bir bool. Varsayılan olarak True'dur. True ise atama bir kilitle korunacaktır; aksi takdirde davranış tanımsızdır ancak daha az çekişme sergileyebilir.
İade:
-
Output: Ref ile aynı. Güncelleme yapıldıktan sonra güncellenen 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 | |
Kamu işlevleri | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Genel statik işlevler | |
|---|---|
UseLocking (bool x) | |
Yapılar | |
|---|---|
| tensorflow:: ops:: ScatterNdUpdate:: Öznitelikler | ScatterNdUpdate için isteğe bağlı öznitelik ayarlayıcılar. |
Genel özellikler
operasyon
Operation operation
çıktı_ref
::tensorflow::Output output_ref
Kamu işlevleri
DağılımNdGüncelleme
ScatterNdUpdate( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
DağılımNdGüncelleme
ScatterNdUpdate( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterNdUpdate::Attrs & attrs )
düğüm
::tensorflow::Node * node() const
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const
Genel statik işlevler
KullanımKilitleme
Attrs UseLocking( bool x )