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
3922eca6
Commit
3922eca6
authored
May 12, 2019
by
rusty1s
Browse files
Update doctest
parent
4a119480
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
torch_scatter/add.py
torch_scatter/add.py
+2
-2
torch_scatter/max.py
torch_scatter/max.py
+2
-2
torch_scatter/min.py
torch_scatter/min.py
+2
-2
torch_scatter/mul.py
torch_scatter/mul.py
+2
-2
torch_scatter/sub.py
torch_scatter/sub.py
+2
-2
No files found.
torch_scatter/add.py
View file @
3922eca6
...
...
@@ -66,8 +66,8 @@ def scatter_add(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
.. testoutput::
tensor([[0, 0, 4, 3, 3, 0],
[2, 4, 4, 0, 0, 0]])
tensor([[0
.
, 0
.
, 4
.
, 3
.
, 3
.
, 0
.
],
[2
.
, 4
.
, 4
.
, 0
.
, 0
.
, 0
.
]])
"""
src
,
out
,
index
,
dim
=
gen
(
src
,
index
,
dim
,
out
,
dim_size
,
fill_value
)
return
out
.
scatter_add_
(
dim
,
index
,
src
)
torch_scatter/max.py
View file @
3922eca6
...
...
@@ -93,8 +93,8 @@ def scatter_max(src, index, dim=-1, out=None, dim_size=None, fill_value=None):
.. testoutput::
tensor([[0, 0, 4, 3, 2, 0],
[2, 4, 3, 0, 0, 0]])
tensor([[0
.
, 0
.
, 4
.
, 3
.
, 2
.
, 0
.
],
[2
.
, 4
.
, 3
.
, 0
.
, 0
.
, 0
.
]])
tensor([[-1, -1, 3, 4, 0, 1],
[ 1, 4, 3, -1, -1, -1]])
"""
...
...
torch_scatter/min.py
View file @
3922eca6
...
...
@@ -95,8 +95,8 @@ def scatter_min(src, index, dim=-1, out=None, dim_size=None, fill_value=None):
.. testoutput::
tensor([[ 0, 0, -4, -3, -2, 0],
[-2, -4, -3, 0, 0, 0]])
tensor([[ 0
.
, 0
.
, -4
.
, -3
.
, -2
.
, 0
.
],
[-2
.
, -4
.
, -3
.
, 0
.
, 0
.
, 0
.
]])
tensor([[-1, -1, 3, 4, 0, 1],
[ 1, 4, 3, -1, -1, -1]])
"""
...
...
torch_scatter/mul.py
View file @
3922eca6
...
...
@@ -84,8 +84,8 @@ def scatter_mul(src, index, dim=-1, out=None, dim_size=None, fill_value=1):
.. testoutput::
tensor([[1, 1, 4, 3, 6, 0],
[6, 4, 8, 1, 1, 1]])
tensor([[1
.
, 1
.
, 4
.
, 3
.
, 6
.
, 0
.
],
[6
.
, 4
.
, 8
.
, 1
.
, 1
.
, 1
.
]])
"""
src
,
out
,
index
,
dim
=
gen
(
src
,
index
,
dim
,
out
,
dim_size
,
fill_value
)
if
src
.
size
(
dim
)
==
0
:
# pragma: no cover
...
...
torch_scatter/sub.py
View file @
3922eca6
...
...
@@ -58,7 +58,7 @@ def scatter_sub(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
.. testoutput::
tensor([[ 0, 0, -4, -3, -3, 0],
[-2, -4, -4, 0, 0, 0]])
tensor([[ 0
.
, 0
.
, -4
.
, -3
.
, -3
.
, 0
.
],
[-2
.
, -4
.
, -4
.
, 0
.
, 0
.
, 0
.
]])
"""
return
scatter_add
(
src
.
neg
(),
index
,
dim
,
out
,
dim_size
,
fill_value
)
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