Commit 9ffad93b authored by rusty1s's avatar rusty1s
Browse files

version update

parent ac8c6916
......@@ -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).
......
......@@ -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;
......@@ -22,4 +25,4 @@ void THTensor_(grid)(THLongTensor *self, THTensor *pos, THTensor *size, THLongTe
}
}
#endif // TH_GENERIC_FILE
#endif // TH_GENERIC_FILE
......@@ -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']
......
from .graclus import graclus_cluster
from .grid import grid_cluster
__version__ = '1.1.2'
__version__ = '1.1.3'
__all__ = ['graclus_cluster', 'grid_cluster', '__version__']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment