tensoreflusso:: ops:: ScatterNdUpdate

#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 avere la 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.

Vedi anche tf.scatter_update e tf.batch_scatter_update .

Argomenti:

  • scope: un oggetto Scope
  • rif: Un tensore mutabile. Dovrebbe provenire da un nodo Variabile .
  • 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:

  • Output : Uguale al rif. Restituito per comodità per le operazioni che desiderano utilizzare i valori aggiornati al termine dell'aggiornamento.

Costruttori e distruttori

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)

Attributi pubblici

operation
output_ref

Funzioni pubbliche

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

Funzioni pubbliche statiche

UseLocking (bool x)

Strutture

tensorflow:: ops:: ScatterNdUpdate:: Attrs

Setter di attributi facoltativi per ScatterNdUpdate .

Attributi pubblici

operazione

Operation operation

output_rif

::tensorflow::Output output_ref

Funzioni pubbliche

ScatterNdUpdate

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

ScatterNdUpdate

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

nodo

::tensorflow::Node * node() const 

operatore::tensorflow::Input

 operator::tensorflow::Input() const 

operatore::tensorflow::Output

 operator::tensorflow::Output() const 

Funzioni pubbliche statiche

UsaLocking

Attrs UseLocking(
  bool x
)