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-cluster
Commits
926960ab
Commit
926960ab
authored
Dec 12, 2018
by
rusty1s
Browse files
pytorch 1.0.0 update
parent
f371e49e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
17 deletions
+11
-17
.travis.yml
.travis.yml
+3
-3
cpu/graclus.cpp
cpu/graclus.cpp
+3
-3
cpu/grid.cpp
cpu/grid.cpp
+1
-1
cpu/utils.h
cpu/utils.h
+2
-8
setup.py
setup.py
+1
-1
torch_cluster/__init__.py
torch_cluster/__init__.py
+1
-1
No files found.
.travis.yml
View file @
926960ab
...
...
@@ -17,9 +17,9 @@ before_install:
-
export CC="gcc-4.9"
-
export CXX="g++-4.9"
install
:
-
if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install http://download.pytorch.org/whl/cpu/torch-
0.4.1
-cp27-cp27mu-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pip install http://download.pytorch.org/whl/cpu/torch-
0.4.1
-cp35-cp35m-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install http://download.pytorch.org/whl/cpu/torch-
0.4.1
-cp36-cp36m-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install http
s
://download.pytorch.org/whl/cpu/torch-
1.0.0
-cp27-cp27mu-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pip install http
s
://download.pytorch.org/whl/cpu/torch-
1.0.0
-cp35-cp35m-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install http
s
://download.pytorch.org/whl/cpu/torch-
1.0.0
-cp36-cp36m-linux_x86_64.whl; fi
-
pip install pycodestyle
-
pip install flake8
-
pip install codecov
...
...
cpu/graclus.cpp
View file @
926960ab
#include <torch/
torch
.h>
#include <torch/
extension
.h>
#include "utils.h"
...
...
@@ -8,7 +8,7 @@ at::Tensor graclus(at::Tensor row, at::Tensor col, int64_t num_nodes) {
std
::
tie
(
row
,
col
)
=
to_csr
(
row
,
col
,
num_nodes
);
auto
row_data
=
row
.
data
<
int64_t
>
(),
col_data
=
col
.
data
<
int64_t
>
();
auto
perm
=
randperm
(
num_nodes
);
auto
perm
=
at
::
randperm
(
num_nodes
,
row
.
options
()
);
auto
perm_data
=
perm
.
data
<
int64_t
>
();
auto
cluster
=
at
::
full
(
num_nodes
,
-
1
,
row
.
options
());
...
...
@@ -43,7 +43,7 @@ at::Tensor weighted_graclus(at::Tensor row, at::Tensor col, at::Tensor weight,
std
::
tie
(
row
,
col
,
weight
)
=
to_csr
(
row
,
col
,
weight
,
num_nodes
);
auto
row_data
=
row
.
data
<
int64_t
>
(),
col_data
=
col
.
data
<
int64_t
>
();
auto
perm
=
randperm
(
num_nodes
);
auto
perm
=
at
::
randperm
(
num_nodes
,
row
.
options
()
);
auto
perm_data
=
perm
.
data
<
int64_t
>
();
auto
cluster
=
at
::
full
(
num_nodes
,
-
1
,
row
.
options
());
...
...
cpu/grid.cpp
View file @
926960ab
#include <torch/
torch
.h>
#include <torch/
extension
.h>
at
::
Tensor
grid
(
at
::
Tensor
pos
,
at
::
Tensor
size
,
at
::
Tensor
start
,
at
::
Tensor
end
)
{
...
...
cpu/utils.h
View file @
926960ab
#pragma once
#include <torch/
torch
.h>
#include <torch/
extension
.h>
std
::
tuple
<
at
::
Tensor
,
at
::
Tensor
>
remove_self_loops
(
at
::
Tensor
row
,
at
::
Tensor
col
)
{
...
...
@@ -15,14 +15,8 @@ remove_self_loops(at::Tensor row, at::Tensor col, at::Tensor weight) {
weight
.
masked_select
(
mask
));
}
at
::
Tensor
randperm
(
int64_t
n
)
{
auto
out
=
at
::
empty
(
n
,
torch
::
CPU
(
at
::
kLong
));
at
::
randperm_out
(
out
,
n
);
return
out
;
}
std
::
tuple
<
at
::
Tensor
,
at
::
Tensor
>
rand
(
at
::
Tensor
row
,
at
::
Tensor
col
)
{
auto
perm
=
randperm
(
row
.
size
(
0
));
auto
perm
=
at
::
randperm
(
row
.
size
(
0
)
,
row
.
options
()
);
return
std
::
make_tuple
(
row
.
index_select
(
0
,
perm
),
col
.
index_select
(
0
,
perm
));
}
...
...
setup.py
View file @
926960ab
...
...
@@ -21,7 +21,7 @@ if CUDA_HOME is not None:
[
'cuda/radius.cpp'
,
'cuda/radius_kernel.cu'
]),
]
__version__
=
'1.2.
0
'
__version__
=
'1.2.
1
'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[]
...
...
torch_cluster/__init__.py
View file @
926960ab
...
...
@@ -5,7 +5,7 @@ from .nearest import nearest
from
.knn
import
knn
,
knn_graph
from
.radius
import
radius
,
radius_graph
__version__
=
'1.2.
0
'
__version__
=
'1.2.
1
'
__all__
=
[
'graclus_cluster'
,
...
...
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