tf.raw_ops.ResourceScatterMax
Объединяет разреженные обновления в переменную, на которую ссылается resource, с помощью операции max.
tf.raw_ops.ResourceScatterMax(
resource, indices, updates, name=None
)
Эта операция вычисляет
# Scalar indices ref[indices, ...] = max(ref[indices, ...], updates[...]) # Vector indices (for each i) ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
Повторяющиеся записи обрабатываются корректно: если несколько indices ссылаются на одно и то же место, их вклады объединяются.
Требуется updates.shape = indices.shape + ref.shape[1:] или updates.shape = [].
| Аргументы | |
|---|---|
resource | Tensor типа resource. Должен исходить из узла Variable. |
indices | Tensor. Должен иметь один из следующих типов: int32, int64. Тензор индексов первого измерения ref. |
updates | Tensor. Должен иметь один из следующих типов: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, bfloat16, qint16, quint16, uint16, complex128, half, uint32, uint64. Тензор обновлённых значений, которые нужно добавить к ref. |
name | Имя операции (необязательно). |
| Возвращает | |
|---|---|
| Созданная операция. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/raw_ops/ResourceScatterMax