README.md 1.9 KB
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
[pypi-image]: https://badge.fury.io/py/torch-sparse.svg
[pypi-url]: https://pypi.python.org/pypi/torch-sparse
[build-image]: https://travis-ci.org/rusty1s/pytorch_sparse.svg?branch=master
[build-url]: https://travis-ci.org/rusty1s/pytorch_sparse
[coverage-image]: https://codecov.io/gh/rusty1s/pytorch_sparse/branch/master/graph/badge.svg
[coverage-url]: https://codecov.io/github/rusty1s/pytorch_sparse?branch=master
rusty1s's avatar
rusty1s committed
7

rusty1s's avatar
rusty1s committed
8
# PyTorch Sparse
rusty1s's avatar
rusty1s committed
9
10
11
12
13
14

[![PyPI Version][pypi-image]][pypi-url]
[![Build Status][build-image]][build-url]
[![Code Coverage][coverage-image]][coverage-url]

--------------------------------------------------------------------------------
rusty1s's avatar
rusty1s committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

This package consists of a small extension library of optimized sparse matrix operations for the use in [PyTorch](http://pytorch.org/), which are missing and or lack autograd support in the main package.
The package consists of the following methods:

* **[Autograd Sparse Tensor Creation](#Autograd Sparse Tensor Creation)**
* **[Autograd Sparse Tensor Value Extraction](#Autograd Sparse Tensor Value Extraction)**
* **[Sparse Sparse Matrix Multiplication](#Sparse Sparse Matrix Multiplication)**

All included operations work on varying data types and are implemented both for CPU and GPU.

## Installation

Ensure that PyTorch 0.4.0 is installed and verify that `cuda/bin` and `cuda/install` are in your `$PATH` and `$CPATH` respectively, *e.g.*:

```
$ echo $PATH
/usr/local/cuda/bin:...

$ echo $CPATH
/usr/local/cuda/install:...
```

Then run:

```
pip install cffi torch-sparse
```

rusty1s's avatar
links  
rusty1s committed
43
44
If you are running into installation problems, please follow [these instructions](https://rusty1s.github.io/pytorch_geometric/build/html/notes/installation.html) and create an [issue](https://github.com/rusty1s/pytorch_sparse/issues).

rusty1s's avatar
rusty1s committed
45
46
47
48
49
50
51
52
53
54
55
## Autograd Sparse Tensor Creation

## Autograd Sparse Tensor Value Extraction

## Sparse Sparse Matrix Multiplication

## Running tests

```
python setup.py test
```