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
2ea9507b
Commit
2ea9507b
authored
Dec 20, 2017
by
rusty1s
Browse files
docstring
parent
b5bffba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
torch_scatter/functions/__init__.py
torch_scatter/functions/__init__.py
+17
-0
No files found.
torch_scatter/functions/__init__.py
View file @
2ea9507b
...
@@ -39,6 +39,23 @@ def scatter_add_(output, index, input, dim=0):
...
@@ -39,6 +39,23 @@ def scatter_add_(output, index, input, dim=0):
def
scatter_add
(
index
,
input
,
dim
=
0
,
max_index
=
None
,
fill_value
=
0
):
def
scatter_add
(
index
,
input
,
dim
=
0
,
max_index
=
None
,
fill_value
=
0
):
"""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 is given by :attr:`max_index` and must be at least size
`index.max(dim) - 1`. If `max_index` is not given, a minimal sized output
tensor is returned. The output tensor is filled with :attr:`fill_value`
before scatter.
A more detailed explanation of the operation is described in
:meth:`~scatter_add_`.
Args:
index (LongTensor): The indices of elements to scatter
input (Tensor): The source tensor
dim (int): The axis along which to index
max_index (int): Output size at dimension :attr:`dim`
fill_value (int): Fill value of output before scatter
"""
output
=
gen_output
(
index
,
input
,
dim
,
max_index
,
fill_value
)
output
=
gen_output
(
index
,
input
,
dim
,
max_index
,
fill_value
)
return
scatter_add_
(
output
,
index
,
input
,
dim
)
return
scatter_add_
(
output
,
index
,
input
,
dim
)
...
...
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