Commit ad6102e8 authored by rusty1s's avatar rusty1s
Browse files

added formula

parent b32abb95
import torch
from .scatter import scatter from .scatter import scatter
from .utils import gen_filled_tensor, gen_output from .utils import gen_filled_tensor, gen_output
...@@ -18,6 +16,10 @@ def scatter_add_(output, index, input, dim=0): ...@@ -18,6 +16,10 @@ def scatter_add_(output, index, input, dim=0):
size :math:`(x_0, ..., x_{i-1}, y, x_{i+1}, ..., x_{n-1})`. Moreover, the size :math:`(x_0, ..., x_{i-1}, y, x_{i+1}, ..., x_{n-1})`. Moreover, the
values of :attr:`index` must be between `0` and `output.size(dim) - 1`. values of :attr:`index` must be between `0` and `output.size(dim) - 1`.
For one-dimensional tensors, the formula is given by
:math:`output_i = \sum_j input_j` where sum is over :math:`j` such that
:math:`index_j = i`.
Args: Args:
output (Tensor): The destination tensor output (Tensor): The destination tensor
index (LongTensor): The indices of elements to scatter index (LongTensor): The indices of elements to scatter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment