mindspore/docs/api/api_python/ops/mindspore.ops.TensorScatter...

28 lines
1.3 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.TensorScatterElements
===================================
.. py:class:: mindspore.ops.TensorScatterElements(axis=0, reduction="none")
`updates` 中所有的元素按照 `reduction` 指定的归约操作写入 `data``indices` 指定的索引处。
`axis` 控制scatter操作的方向。
更多参考详见: :func:`mindspore.ops.tensor_scatter_elements`
.. warning::
如果 `indices` 中有多个索引向量对应于同一位置,则输出中该位置值是不确定的。
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **axis** (int可选) - 指定进行操作的轴。默认值: ``0``
- **reduction** (str可选) - 指定进行的reduction操作。默认值是 ``"none"`` ,可选值为 ``"add"``
输入:
- **data** (Tensor) - 输入Tensor。其rank必须至少为1。
- **indices** (Tensor) - `data` 执行scatter操作的目标索引数据类型为int32或int64。其rank必须和 `data` 一致。取值范围是[-s, s)s是 `data``axis` 指定轴的size。
- **updates** (Tensor) - 指定与 `data` 进行scatter操作的Tensor其数据类型与 `data` 类型相同shape与 `indices` 的shape相同。
输出:
Tensorshape和数据类型与输入 `data` 相同。