Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-scatter
Commits
0b0d099e
Commit
0b0d099e
authored
Dec 21, 2017
by
rusty1s
Browse files
added return type
parent
5acf2355
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
docs/source/conf.py
docs/source/conf.py
+3
-1
torch_scatter/functions/__init__.py
torch_scatter/functions/__init__.py
+4
-1
torch_scatter/functions/add.py
torch_scatter/functions/add.py
+6
-6
No files found.
docs/source/conf.py
View file @
0b0d099e
...
...
@@ -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
()]
...
...
torch_scatter/functions/__init__.py
View file @
0b0d099e
...
...
@@ -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
)
...
...
torch_scatter/functions/add.py
View file @
0b0d099e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment