Commit 0b0d099e authored by rusty1s's avatar rusty1s
Browse files

added return type

parent 5acf2355
......@@ -24,7 +24,9 @@ master_doc = 'index'
author = 'Matthias Fey'
project = 'pytorch_scatter'
copyright = '{}, {}'.format(datetime.datetime.now().year, author)
version = release = __version__
version = 'master ({})'.format(__version__)
release = 'master'
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
......
......@@ -54,7 +54,10 @@ def scatter_mean(index, input, dim=0, max_index=None, fill_value=0):
def scatter_max_(output, index, input, dim=0):
"""If multiple indices reference the same location, the maximal
contribution gets taken."""
contribution gets taken.
:rtype: (:class:`Tensor`, :class:`LongTensor`)
"""
arg_output = gen_filled_tensor(index, output.size(), fill_value=-1)
return scatter('max', dim, output, index, input, arg_output)
......
......@@ -2,9 +2,7 @@ from .utils import gen_output
def scatter_add_(output, index, input, dim=0):
""" -> Tensor
Sums up all values from the tensor :attr:`input` into :attr:`output` at
"""Sums up all values from the tensor :attr:`input` into :attr:`output` at
the indices specified in the :attr:`index` tensor along an given axis
:attr:`dim`. For each value in :attr:`input`, its output index is specified
by its index in :attr:`input` for dimensions outside of :attr:`dim` and by
......@@ -30,6 +28,8 @@ def scatter_add_(output, index, input, dim=0):
input (Tensor): The source tensor
dim (int, optional): The axis along which to index
:rtype: :class:`Tensor`
.. testsetup::
import torch
......@@ -53,9 +53,7 @@ def scatter_add_(output, index, input, dim=0):
def scatter_add(index, input, dim=0, size=None, fill_value=0):
""" -> Tensor
Sums ap all values from the tensor :attr:`input` at the indices
"""Sums ap all values from the tensor :attr:`input` at the indices
specified in the :attr:`index` tensor along an given axis :attr:`dim`.
The output size at dimension :attr:`dim` is given by :attr:`size` and must
be at least size `index.max(dim) - 1`. If :attr:`size` is not given, a
......@@ -79,6 +77,8 @@ def scatter_add(index, input, dim=0, size=None, fill_value=0):
size (int, optional): Output size at dimension :attr:`dim`
fill_value (int, optional): Initial filling of output tensor
:rtype: :class:`Tensor`
.. testsetup::
import torch
......
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