# ResourceScatterAdd

public final class **ResourceScatterAdd** Adds sparse updates to the variable referenced by \`resource\`.


This operation computes


# Scalar indices
ref\[indices, ...\] += updates\[...\]


# Vector indices (for each i)
ref\[indices\[i\], ...\] += updates\[i, ...\]


# High rank indices (for each i, ..., j)
ref\[indices\[i, ..., j\], ...\] += updates\[i, ..., j, ...\]


Duplicate entries are handled correctly: if multiple \`indices\` reference
the same location, their contributions add.


Requires \`updates.shape = indices.shape + ref.shape\[1:\]\` or \`updates.shape = \[\]\`.


![](https://www.tensorflow.org/images/ScatterAdd.png)

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

### Public Methods

|---|---|
| static \<T extends Number, U\> [ResourceScatterAdd](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ResourceScatterAdd) | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ResourceScatterAdd#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<?>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<U>))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<?\> resource, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> indices, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<U\> updates) Factory method to create a class wrapping a new ResourceScatterAdd operation. |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [ResourceScatterAdd](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ResourceScatterAdd)
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<?\> resource, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> indices, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<U\> updates)

Factory method to create a class wrapping a new ResourceScatterAdd operation.

##### Parameters

| scope | current scope |
| resource | Should be from a \`Variable\` node. |
| indices | A tensor of indices into the first dimension of \`ref\`. |
| updates | A tensor of updated values to add to \`ref\`. |
|---|---|

##### Returns

- a new instance of ResourceScatterAdd