tensoreflusso:: ops:: ScatterNdAdd

#include <state_ops.h>

Applica un'addizione sparsa a singoli valori o sezioni in una Variabile .

Riepilogo

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 aggiungere 4 elementi sparsi a un tensore di rango 1 a 8 elementi. In Python, tale aggiunta sarebbe simile a questa:

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])
add = tf.scatter_nd_add(ref, indices, updates)
with tf.Session() as sess:
  print sess.run(add)

L'aggiornamento risultante a ref sarebbe simile al seguente:

[1, 13, 3, 14, 14, 6, 7, 20]

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

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

ScatterNdAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates)
ScatterNdAdd (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ScatterNdAdd::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:: ScatterNdAdd:: Attrs

Setter di attributi facoltativi per ScatterNdAdd .

Attributi pubblici

operazione

Operation operation

output_rif

::tensorflow::Output output_ref

Funzioni pubbliche

ScatterNdAdd

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

ScatterNdAdd

 ScatterNdAdd(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  ::tensorflow::Input indices,
  ::tensorflow::Input updates,
  const ScatterNdAdd::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
)