tensoreflusso:: ops:: ResourceScatterNdUpdate

#include <state_ops.h>

Applica updates sparsi a singoli valori o sezioni all'interno di un dato.

Riepilogo

variabile secondo indices .

ref è un Tensor di rango P e indices è un Tensor di rango Q .

indices devono essere tensori interi, contenenti indici in ref . Deve essere di forma [d_0, ..., d_{Q-2}, K] dove 0 < K <= P .

La dimensione più interna degli indices (con lunghezza K ) corrisponde agli indici in elementi (se K = P ) o fette (se K < P ) lungo la K -esima dimensione di ref .

updates sono Tensor di rango Q-1+PK con forma:

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

Ad esempio, supponiamo di voler aggiornare 4 elementi sparsi in un tensore di rango 1 a 8 elementi. In Python, l'aggiornamento sarebbe simile a questo:

    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)

L'aggiornamento risultante a ref sarebbe simile al seguente:

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

Vedi tf.scatter_nd per maggiori dettagli su come apportare aggiornamenti alle sezioni.

Argomenti:

  • scope: un oggetto Scope
  • ref: un handle di risorsa. Deve provenire da un VarHandleOp.
  • indici: A Tensore . Deve essere uno dei seguenti tipi: int32, int64. Un tensore di indici nel rif.
  • aggiornamenti: Un Tensore . Deve essere dello stesso tipo del rif. Un tensore di valori aggiornati da aggiungere al rif.

Attributi facoltativi (vedi Attrs ):

  • use_locking: un valore bool opzionale. Il valore predefinito è Vero. Se True, l'assegnazione sarà protetta da un lucchetto; altrimenti il ​​comportamento non è definito, ma può mostrare meno contesa.

Ritorna:

Costruttori e distruttori

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)

Attributi pubblici

operation

Funzioni pubbliche

operator::tensorflow::Operation () const

Funzioni pubbliche statiche

UseLocking (bool x)

Strutture

tensorflow:: ops:: ResourceScatterNdUpdate:: Attrs

Setter di attributi facoltativi per ResourceScatterNdUpdate .

Attributi pubblici

operazione

Operation operation

Funzioni pubbliche

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::Operazione

 operator::tensorflow::Operation() const 

Funzioni pubbliche statiche

UsaLocking

Attrs UseLocking(
  bool x
)