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
9ffad93b
Commit
9ffad93b
authored
Aug 13, 2018
by
rusty1s
Browse files
version update
parent
ac8c6916
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
README.md
README.md
+15
-2
aten/TH/generic/THGrid.c
aten/TH/generic/THGrid.c
+8
-5
setup.py
setup.py
+1
-1
torch_cluster/__init__.py
torch_cluster/__init__.py
+1
-1
No files found.
README.md
View file @
9ffad93b
...
...
@@ -23,14 +23,27 @@ All included operations work on varying data types and are implemented both for
## Installation
Check that
`nvcc`
is accessible from terminal, e.g.
`nvcc --version`
.
If not, add cuda (
`/usr/local/cuda/bin`
) to your
`$PATH`
.
Ensure that at least PyTorch 0.4.1 is installed and verify that
`cuda/bin`
and
`cuda/install`
are in your
`$PATH`
and
`$CPATH`
respectively,
*e.g.*
:
```
$ python -c "import torch; print(torch.__version__)"
>>> 0.4.1
$ echo $PATH
>>> /usr/local/cuda/bin:...
$ echo $CPATH
>>> /usr/local/cuda/install:...
```
Then run:
```
pip install cffi torch-cluster
```
If you are running into any installation problems, please create an
[
issue
](
https://github.com/rusty1s/pytorch_cluster/issues
)
.
## Graclus
A greedy clustering algorithm of picking an unmarked vertex and matching it with one its unmarked neighbors (that maximizes its edge weight).
...
...
aten/TH/generic/THGrid.c
View file @
9ffad93b
...
...
@@ -2,7 +2,8 @@
#define TH_GENERIC_FILE "generic/THGrid.c"
#else
void
THTensor_
(
grid
)(
THLongTensor
*
self
,
THTensor
*
pos
,
THTensor
*
size
,
THLongTensor
*
count
)
{
void
THTensor_
(
grid
)(
THLongTensor
*
self
,
THTensor
*
pos
,
THTensor
*
size
,
THLongTensor
*
count
)
{
int64_t
*
selfData
=
THLongTensor_data
(
self
);
real
*
posData
=
THTensor_
(
data
)(
pos
);
real
*
sizeData
=
THTensor_
(
data
)(
size
);
...
...
@@ -10,11 +11,13 @@ void THTensor_(grid)(THLongTensor *self, THTensor *pos, THTensor *size, THLongTe
int64_t
posStride1
=
THTensor_
(
stride
)(
pos
,
1
);
int64_t
*
countData
=
THLongTensor_data
(
count
);
ptrdiff_t
n
,
d
;
int64_t
coef
,
value
;
ptrdiff_t
n
,
d
;
int64_t
coef
,
value
;
for
(
n
=
0
;
n
<
THTensor_
(
size
)(
pos
,
0
);
n
++
)
{
coef
=
1
;
value
=
0
;
coef
=
1
;
value
=
0
;
for
(
d
=
0
;
d
<
THTensor_
(
size
)(
pos
,
1
);
d
++
)
{
value
+=
coef
*
(
int64_t
)
(
posData
[
d
*
posStride1
]
/
sizeData
[
d
]);
value
+=
coef
*
(
int64_t
)(
posData
[
d
*
posStride1
]
/
sizeData
[
d
]);
coef
*=
countData
[
d
];
}
posData
+=
posStride0
;
...
...
setup.py
View file @
9ffad93b
...
...
@@ -2,7 +2,7 @@ from os import path as osp
from
setuptools
import
setup
,
find_packages
__version__
=
'1.1.
2
'
__version__
=
'1.1.
3
'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[
'cffi'
]
...
...
torch_cluster/__init__.py
View file @
9ffad93b
from
.graclus
import
graclus_cluster
from
.grid
import
grid_cluster
__version__
=
'1.1.
2
'
__version__
=
'1.1.
3
'
__all__
=
[
'graclus_cluster'
,
'grid_cluster'
,
'__version__'
]
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