tensorflow::ops::ScatterAdd
#include <state_ops.h>
Добавляет разреженные обновления к ссылке на переменную.
Краткое описание
Данная операция вычисляет
# 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, ...]
После выполнения обновления эта операция выводит ref. Это упрощает цепочку операций, которым нужно использовать начальное значение.
Дублированные записи обрабатываются корректно: если несколько indices ссылаются на одно и то же место, их значения суммируются.
Требуется updates.shape = indices.shape + ref.shape[1:] или updates.shape = [].
Аргументы:
- scope: Объект Scope
- ref: Должен быть из узла
Variable. - indices: Массив индексов в первом измерении
ref. - updates: Массив обновляемых значений для добавления к
ref.
Необязательные атрибуты (см. Attrs):
- use_locking: Если True, добавление будет защищено блокировкой; в противном случае поведение не определено, но может быть меньше конкуренции.
Возвращает:
-
Output: = То же, что иref. Возвращается для удобства операций, которые хотят использовать обновленные значения после завершения обновления.
| Конструкторы и деструкторы | |
|---|---|
ScatterAdd(const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates) |
|
ScatterAdd(const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterAdd::Attrs & attrs) |
| Общественные атрибуты | |
|---|---|
operation |
|
output_ref |
|
| Общественные функции | |
|---|---|
node() const |
::tensorflow::Node * |
operator::tensorflow::Input() const |
|
operator::tensorflow::Output() const |
|
| Общественные статические функции | |
|---|---|
UseLocking(bool x) |
|
| Структуры | |
|---|---|
| tensorflow::ops::ScatterAdd::Attrs | Необязательные настройки атрибутов для ScatterAdd. |
Общественные атрибуты
operation
Operation operation
output_ref
::tensorflow::Output output_ref
Общественные функции
ScatterAdd
ScatterAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates )
ScatterAdd
ScatterAdd( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterAdd::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Общественные статические функции
UseLocking
Attrs UseLocking( bool x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/scatter-add