tensor akışı:: işlem:: Kaynak DağılımıNdAdd
#include <state_ops.h>Bir Değişkendeki tek tek değerlere veya dilimlere seyrek toplama uygular.
Özet
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. [d_0, ..., d_{Q-2}, K] şeklinde olmalıdır, 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, 8 elemanlı bir derece 1 tensöre 4 dağınık eleman 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)
Sonuçta ortaya çıkan ref güncellemesi şöyle görünecektir:
[1, 13, 3, 14, 14, 6, 7, 20]
Dilimlerde güncellemelerin nasıl yapılacağı hakkında daha fazla ayrıntı için tf.scatter_nd bakın.
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- ref: Bir kaynak tanıtıcısı. Bir VarHandleOp'tan 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. Ref'e eklenecek 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:
- oluşturulan
Operation
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 | |
Kamu işlevleri | |
|---|---|
operator::tensorflow::Operation () const | |
Genel statik işlevler | |
|---|---|
UseLocking (bool x) | |
Yapılar | |
|---|---|
| tensorflow:: ops:: ResourceScatterNdAdd:: Öznitelikler | ResourceScatterNdAdd için isteğe bağlı öznitelik ayarlayıcılar. |
Genel özellikler
operasyon
Operation operation
Kamu işlevleri
Kaynak DağılımıNdAdd
ResourceScatterNdAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
Kaynak DağılımıNdAdd
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
Genel statik işlevler
KullanımKilitleme
Attrs UseLocking( bool x )