ScatterAdd
tensorflow C++ API
Adds sparse updates to a variable reference.
Summary
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,...]
This operation outputs ref
after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple indices
reference the same location, their contributions add.
Requires updates.shape = indices.shape + ref.shape[1:]
.
Arguments:
- scope: A Scope object
- ref: 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
.
Optional attributes (see Attrs
):
- use_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
Output
: = Same asref
. Returned as a convenience for operations that want to use the updated values after the update is done.
ScatterAdd block
Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_state.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
- Input ref: connect Input node.
- Input indices: connect Input node.
- Input updates: connect Input node.
- ScatterAdd erMul ::Attrs attrs : Input attrs in value. ex)use_locking_ = true;
Return:
- Output output : Output object of ScatterAdd class object.
Result:
- std::vector(Tensor) product_result : Returned object of executed result by calling session.
Using Method
*Assign에 연결된 ClientSession은 Assign값을 확인하기 위해 작성된 temp입니다. ClientSession은 처리순서가 있으므로 테스트시 생성을 마지막에 작성하여 사용합니다.