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-spline-conv
Commits
af9d775b
"vscode:/vscode.git/clone" did not exist on "fc55225f0872488c1b2b7bef23eb61c7d725c3c7"
Commit
af9d775b
authored
Mar 23, 2018
by
rusty1s
Browse files
changed arg order
parent
19d744fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
test/test_spline_conv.py
test/test_spline_conv.py
+4
-4
torch_spline_conv/functions/spline_conv.py
torch_spline_conv/functions/spline_conv.py
+1
-1
No files found.
test/test_spline_conv.py
View file @
af9d775b
...
@@ -21,7 +21,7 @@ def test_spline_conv_cpu(tensor):
...
@@ -21,7 +21,7 @@ def test_spline_conv_cpu(tensor):
bias
=
Tensor
(
tensor
,
[
1
])
bias
=
Tensor
(
tensor
,
[
1
])
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
is_open_spline
,
root_weight
,
1
,
bias
)
is_open_spline
,
1
,
root_weight
,
bias
)
edgewise_output
=
[
edgewise_output
=
[
1
*
0.25
*
(
0.5
+
1.5
+
4.5
+
5.5
)
+
2
*
0.25
*
(
1
+
2
+
5
+
6
),
1
*
0.25
*
(
0.5
+
1.5
+
4.5
+
5.5
)
+
2
*
0.25
*
(
1
+
2
+
5
+
6
),
...
@@ -45,7 +45,7 @@ def test_spline_conv_cpu(tensor):
...
@@ -45,7 +45,7 @@ def test_spline_conv_cpu(tensor):
root_weight
,
bias
=
Variable
(
root_weight
),
Variable
(
bias
)
root_weight
,
bias
=
Variable
(
root_weight
),
Variable
(
bias
)
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
is_open_spline
,
root_weight
,
1
,
bias
)
is_open_spline
,
1
,
root_weight
,
bias
)
output
=
[
pytest
.
approx
(
x
,
0.01
)
for
x
in
output
.
data
.
view
(
-
1
).
tolist
()]
output
=
[
pytest
.
approx
(
x
,
0.01
)
for
x
in
output
.
data
.
view
(
-
1
).
tolist
()]
assert
output
==
expected_output
assert
output
==
expected_output
...
@@ -81,7 +81,7 @@ def test_spline_conv_gpu(tensor):
...
@@ -81,7 +81,7 @@ def test_spline_conv_gpu(tensor):
bias
=
Tensor
(
tensor
,
[
1
])
bias
=
Tensor
(
tensor
,
[
1
])
expected_output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
expected_output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
is_open_spline
,
root_weight
,
1
,
bias
)
is_open_spline
,
1
,
root_weight
,
bias
)
x
,
edge_index
,
pseudo
=
x
.
cuda
(),
edge_index
.
cuda
(),
pseudo
.
cuda
()
x
,
edge_index
,
pseudo
=
x
.
cuda
(),
edge_index
.
cuda
(),
pseudo
.
cuda
()
weight
,
kernel_size
=
weight
.
cuda
(),
kernel_size
.
cuda
()
weight
,
kernel_size
=
weight
.
cuda
(),
kernel_size
.
cuda
()
...
@@ -89,7 +89,7 @@ def test_spline_conv_gpu(tensor):
...
@@ -89,7 +89,7 @@ def test_spline_conv_gpu(tensor):
bias
=
bias
.
cuda
()
bias
=
bias
.
cuda
()
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
output
=
spline_conv
(
x
,
edge_index
,
pseudo
,
weight
,
kernel_size
,
is_open_spline
,
root_weight
,
1
,
bias
)
is_open_spline
,
1
,
root_weight
,
bias
)
assert
output
.
cpu
().
tolist
()
==
expected_output
.
tolist
()
assert
output
.
cpu
().
tolist
()
==
expected_output
.
tolist
()
...
...
torch_spline_conv/functions/spline_conv.py
View file @
af9d775b
...
@@ -11,8 +11,8 @@ def spline_conv(x,
...
@@ -11,8 +11,8 @@ def spline_conv(x,
weight
,
weight
,
kernel_size
,
kernel_size
,
is_open_spline
,
is_open_spline
,
root_weight
=
None
,
degree
=
1
,
degree
=
1
,
root_weight
=
None
,
bias
=
None
):
bias
=
None
):
# Convolve over each node.
# Convolve over each node.
...
...
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