[ torch 参数更多 ]torch.Tensor.index_add_¶
torch.Tensor.index_add_¶
torch.Tensor.index_add_(dim, index, source, *, alpha=1)
paddle.index_add_¶
paddle.index_add_(x, index, axis, value, name=None)
其中 Pytorch 与 Paddle 参数有差异,具体如下:
参数映射¶
| PyTorch | PaddlePaddle | 备注 | | ————- | ———— | —————————————————— | | - | x | 表示输入的 Tensor 。 | | dim | axis | 表示进行运算的轴,仅参数名不一致。 | | index | index | 包含索引下标的 1-D Tensor。 | | source | value | 被加的 Tensor,仅参数名不一致。 | | alpha | - | source 的 缩放倍数, Paddle 无此参数,需要进行转写。Paddle 应将 alpha 和 source 的乘积作为 value。 |