scatter_add¶
dragon.vm.torch.scatter_add(
input,
dim,
index,
src,
out=None
)[source]¶Add elements along the given dimension of index.
Number of dimensions of
input,index, andsrcshould be same. For 3-d input, output is updated as:Examples:
- Parameters:
- input (dragon.vm.torch.Tensor) – The input tensor.
- dim (int) – The dimension of index values.
- index (dragon.vm.torch.Tensor) – The index tensor.
- src (Union[dragon.vm.torch.Tensor, number]) – The tensor to add from.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.