mindspore.ops.scatter_add ========================= .. py:function:: mindspore.ops.scatter_add(input_x, indices, updates) 根据指定索引和更新值对 `input_x` 进行加法更新。 .. warning:: 2.9.0(不含)之后版本非兼容性变更:该接口将改为 `dim/index/src` 形式的 scatter add。 .. math:: \text{input_x}[\text{indices}[i, ..., j], :] \mathrel{+}= \text{updates}[i, ..., j, :] .. note:: - 支持隐式类型转换、类型提升。 - 因Parameter对象不支持类型转换,当 `input_x` 为低精度数据类型时,会抛出异常。 - `updates` 的shape为 `indices.shape + input_x.shape[1:]` 。 参数: - **input_x** (Union[Parameter, Tensor]) - 输入的parameter或tensor。 - **indices** (Tensor) - 指定索引。 - **updates** (Tensor) - 更新值。 返回: Tensor