mindspore/docs/api/api_python/ops/mindspore.ops.func_scatter.rst

19 lines
716 B
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.scatter
=======================================
.. py:function:: mindspore.ops.scatter(input, axis, index, src)
根据指定索引将 `src` 中的值更新到 `input` 中并返回输出。
有关更多详细信息,请参阅 :func:`mindspore.ops.tensor_scatter_elements`
.. note::
如果src为tensor则仅当src的shape和index的shape相同时支持求反向梯度。
参数:
- **input** (Tensor) - 输入tensor。
- **axis** (int) - 要进行更新操作的轴。
- **index** (Tensor) - 要进行更新操作的索引。
- **src** (Tensor, float) - 指定对 `input` 进行更新操作的数据。
返回:
Tensor