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
eefc3bd3
Commit
eefc3bd3
authored
Oct 22, 2021
by
rusty1s
Browse files
upgrade to PyTorch 1.10
parent
b5fd0ca3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
.github/workflows/testing.yml
.github/workflows/testing.yml
+1
-1
setup.py
setup.py
+1
-1
test/test_conv.py
test/test_conv.py
+1
-1
torch_spline_conv/conv.py
torch_spline_conv/conv.py
+2
-2
No files found.
.github/workflows/testing.yml
View file @
eefc3bd3
...
@@ -11,7 +11,7 @@ jobs:
...
@@ -11,7 +11,7 @@ jobs:
matrix
:
matrix
:
os
:
[
ubuntu-latest
,
windows-latest
]
os
:
[
ubuntu-latest
,
windows-latest
]
python-version
:
[
3.6
]
python-version
:
[
3.6
]
torch-version
:
[
1.
8
.0
,
1.
9
.0
]
torch-version
:
[
1.
9
.0
,
1.
10
.0
]
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
...
...
setup.py
View file @
eefc3bd3
...
@@ -29,7 +29,7 @@ def get_extensions():
...
@@ -29,7 +29,7 @@ def get_extensions():
for
main
,
suffix
in
product
(
main_files
,
suffices
):
for
main
,
suffix
in
product
(
main_files
,
suffices
):
define_macros
=
[]
define_macros
=
[]
extra_compile_args
=
{
'cxx'
:
[
'-O2'
]}
extra_compile_args
=
{
'cxx'
:
[
'-O2'
]}
extra_link_args
=
[
'-s'
]
extra_link_args
=
[]
if
suffix
==
'cuda'
:
if
suffix
==
'cuda'
:
define_macros
+=
[(
'WITH_CUDA'
,
None
)]
define_macros
+=
[(
'WITH_CUDA'
,
None
)]
...
...
test/test_conv.py
View file @
eefc3bd3
...
@@ -58,7 +58,7 @@ def test_spline_conv_forward(test, dtype, device):
...
@@ -58,7 +58,7 @@ def test_spline_conv_forward(test, dtype, device):
@
pytest
.
mark
.
parametrize
(
'degree,device'
,
product
(
degrees
,
devices
))
@
pytest
.
mark
.
parametrize
(
'degree,device'
,
product
(
degrees
,
devices
))
def
test_spline_
basis
_backward
(
degree
,
device
):
def
test_spline_
conv
_backward
(
degree
,
device
):
x
=
torch
.
rand
((
3
,
2
),
dtype
=
torch
.
double
,
device
=
device
)
x
=
torch
.
rand
((
3
,
2
),
dtype
=
torch
.
double
,
device
=
device
)
x
.
requires_grad_
()
x
.
requires_grad_
()
edge_index
=
tensor
([[
0
,
1
,
1
,
2
],
[
1
,
0
,
2
,
1
]],
torch
.
long
,
device
)
edge_index
=
tensor
([[
0
,
1
,
1
,
2
],
[
1
,
0
,
2
,
1
]],
torch
.
long
,
device
)
...
...
torch_spline_conv/conv.py
View file @
eefc3bd3
...
@@ -69,10 +69,10 @@ def spline_conv(x: torch.Tensor, edge_index: torch.Tensor,
...
@@ -69,10 +69,10 @@ def spline_conv(x: torch.Tensor, edge_index: torch.Tensor,
# Weight root node separately (if wished).
# Weight root node separately (if wished).
if
root_weight
is
not
None
:
if
root_weight
is
not
None
:
out
=
out
+
torch
.
matmul
(
x
,
root_weight
)
out
+=
x
@
root_weight
# Add bias (if wished).
# Add bias (if wished).
if
bias
is
not
None
:
if
bias
is
not
None
:
out
=
out
+
bias
out
+
=
bias
return
out
return
out
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