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
8099c537
"git@developer.sourcefind.cn:change/sglang.git" did not exist on "4725e3f65218b441789b685c84dda810fcb62a79"
Commit
8099c537
authored
Feb 11, 2018
by
rusty1s
Browse files
added new tests
parent
f0fdfe20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
34 deletions
+36
-34
setup.py
setup.py
+1
-1
test/backward.json
test/backward.json
+33
-33
test/utils.py
test/utils.py
+2
-0
No files found.
setup.py
View file @
8099c537
...
...
@@ -2,7 +2,7 @@ from os import path as osp
from
setuptools
import
setup
,
find_packages
__version__
=
'0.
2.3
'
__version__
=
'0.
3.0
'
url
=
'https://github.com/rusty1s/pytorch_scatter'
install_requires
=
[
'cffi'
]
...
...
test/backward.json
View file @
8099c537
[
{
"name"
:
"add"
,
"index"
:
[
[
4
,
5
,
4
,
2
,
3
],
[
0
,
0
,
2
,
2
,
1
]
],
"input"
:
[
[
2
,
0
,
1
,
4
,
3
]
,
[
0
,
2
,
1
,
3
,
4
]
],
"dim"
:
1
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
,
30
,
40
,
50
,
60
],
[
15
,
25
,
35
,
45
,
55
,
65
]
],
"expected"
:
[
[
50
,
60
,
50
,
30
,
40
],
[
15
,
15
,
35
,
35
,
25
]
]
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
6
,
4
,
8
,
8
,
4
]
},
{
"name"
:
"
add
"
,
"index"
:
[
[
0
,
0
]
,
[
1
,
1
],
[
1
,
1
],
[
0
,
0
]
],
"input"
:
[
[
5
,
2
]
,
[
2
,
5
]
,
[
4
,
3
],
[
1
,
3
]
],
"name"
:
"
sub
"
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
],
[
15
,
25
]
],
"expected"
:
[
[
10
,
20
],
[
15
,
25
],
[
15
,
25
],
[
10
,
20
]
]
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
-6
,
-4
,
-8
,
-8
,
-4
]
},
{
"name"
:
"mean"
,
"index"
:
[
[
4
,
5
,
4
,
2
,
3
],
[
0
,
0
,
2
,
2
,
1
]
],
"input"
:
[
[
2
,
0
,
1
,
4
,
3
]
,
[
0
,
2
,
1
,
3
,
4
]
],
"dim"
:
1
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
,
30
,
40
,
50
,
60
],
[
15
,
25
,
35
,
45
,
55
,
65
]
],
"expected"
:
[
[
50
,
60
,
50
,
30
,
40
],
[
15
,
15
,
35
,
35
,
2
5
]
]
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
6
,
2
,
4
,
4
,
2
]
},
{
"name"
:
"m
ean
"
,
"index"
:
[
[
0
,
0
]
,
[
1
,
1
],
[
1
,
1
],
[
0
,
0
]
],
"input"
:
[
[
5
,
2
]
,
[
2
,
5
]
,
[
4
,
3
],
[
1
,
3
]
],
"name"
:
"m
ax
"
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
],
[
15
,
25
]
],
"expected"
:
[
[
10
,
20
],
[
15
,
25
],
[
15
,
25
],
[
10
,
20
]
]
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
6
,
0
,
0
,
8
,
4
]
},
{
"name"
:
"m
ax
"
,
"index"
:
[
[
4
,
5
,
4
,
2
,
3
],
[
0
,
0
,
2
,
2
,
1
]
],
"input"
:
[
[
2
,
0
,
1
,
4
,
3
]
,
[
0
,
2
,
1
,
3
,
4
]
],
"dim"
:
1
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
,
30
,
40
,
50
,
60
],
[
15
,
25
,
35
,
45
,
55
,
65
]
],
"expected"
:
[
[
50
,
60
,
0
,
30
,
40
],
[
0
,
15
,
0
,
35
,
25
]
]
"name"
:
"m
in
"
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
3
,
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
6
,
4
,
8
,
0
,
0
]
},
{
"name"
:
"m
ax
"
,
"index"
:
[
[
0
,
0
]
,
[
1
,
1
],
[
1
,
1
],
[
0
,
0
]
],
"input"
:
[
[
5
,
2
]
,
[
2
,
5
]
,
[
4
,
3
],
[
1
,
3
]
],
"name"
:
"m
ul
"
,
"index"
:
[
2
,
0
,
1
,
1
,
0
],
"input"
:
[
1
,
2
,
3
,
4
,
5
],
"dim"
:
0
,
"fill_value"
:
0
,
"grad"
:
[
[
10
,
20
],
[
15
,
25
]
],
"expected"
:
[
[
10
,
0
],
[
0
,
25
],
[
15
,
0
],
[
0
,
20
]
]
"fill_value"
:
2
,
"grad"
:
[
4
,
8
,
6
],
"expected"
:
[
12
,
40
,
64
,
48
,
16
]
}
]
test/utils.py
View file @
8099c537
...
...
@@ -3,6 +3,8 @@ from torch._tensor_docs import tensor_classes
tensors
=
[
t
[:
-
4
]
for
t
in
tensor_classes
]
tensors
.
remove
(
'ShortTensor'
)
# TODO: PyTorch `atomicAdd` bug with short type.
tensors
.
remove
(
'ByteTensor'
)
# We cannot properly test unsigned values.
tensors
.
remove
(
'CharTensor'
)
# Overflow on gradient computations :(
def
Tensor
(
str
,
x
):
...
...
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