tensorflow :: ops :: ResourceScatterNdUpdate

#include <state_ops.h>

Menerapkan updates renggang ke nilai individu atau irisan dalam yang diberikan.

Ringkasan

variabel menurut indices .

ref adalah Tensor dengan peringkat P dan indices adalah Tensor peringkat Q

indices harus berupa tensor integer, yang berisi indeks menjadi ref . Harus berbentuk [d_0, ..., d_{Q-2}, K] mana 0 < K <= P

Dimensi paling dalam dari indices (dengan panjang K ) sesuai dengan indeks menjadi elemen (jika K = P ) atau irisan (jika K < P ) sepanjang dimensi K dari ref .

updates Tensor rank Q-1+PK dengan bentuk:

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

Misalnya, kita ingin memperbarui 4 elemen yang tersebar menjadi tensor peringkat-1 menjadi 8 elemen. Di Python, pembaruan itu akan terlihat seperti ini:

    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)

Pembaruan yang dihasilkan untuk ref akan terlihat seperti ini:

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

Lihat tf.scatter_nd untuk detail selengkapnya tentang cara memperbarui slice.

Argumen:

  • scope: Objek Scope
  • ref: Sebuah pegangan sumber daya. Harus dari VarHandleOp.
  • indeks: A Tensor . Harus salah satu dari jenis berikut: int32, int64. Tensor indeks menjadi ref.
  • update: Tensor . Harus memiliki tipe yang sama dengan ref. Tensor nilai yang diperbarui untuk ditambahkan ke ref.

Atribut opsional (lihat Attrs ):

  • use_locking: Bool opsional. Default-nya adalah True. Jika Benar, tugas akan dilindungi oleh kunci; jika tidak, perilakunya tidak ditentukan, tetapi mungkin menunjukkan lebih sedikit pertentangan.

Pengembalian:

Pembangun dan Penghancur

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

Atribut publik

operation

Fungsi publik

operator::tensorflow::Operation () const

Fungsi statis publik

UseLocking (bool x)

Structs

tensorflow :: ops :: ResourceScatterNdUpdate :: Attrs

Penyetel atribut opsional untuk ResourceScatterNdUpdate .

Atribut publik

operasi

Operation operation

Fungsi publik

ResourceScatterNdUpdate

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

ResourceScatterNdUpdate

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

operator :: tensorflow :: Operasi

 operator::tensorflow::Operation() const 

Fungsi statis publik

UseLocking

Attrs UseLocking(
  bool x
)