torch.Tensor.index_add Tensor.index_add(dim, index, source, *, alpha=1) → Tensor torch.Tensor.index_add_() 的独立版本。 或者更自然的表达方式: 与 torch.Tensor.index_add_() 功能类似的独立版本。