Unverified Commit 7bb2fac5 authored by Matthias Fey's avatar Matthias Fey Committed by GitHub
Browse files

Merge pull request #20 from ekagra-ranjan/patch-2

Fix Docs
parents bbcfa9b7 ccd5ddd3
...@@ -77,6 +77,7 @@ For scattering, any operation of [`torch_scatter`](https://github.com/rusty1s/py ...@@ -77,6 +77,7 @@ For scattering, any operation of [`torch_scatter`](https://github.com/rusty1s/py
### Example ### Example
```python ```python
import torch
from torch_sparse import coalesce from torch_sparse import coalesce
index = torch.tensor([[1, 0, 1, 0, 2, 1], index = torch.tensor([[1, 0, 1, 0, 2, 1],
...@@ -120,6 +121,7 @@ Transposes dimensions 0 and 1 of a sparse matrix. ...@@ -120,6 +121,7 @@ Transposes dimensions 0 and 1 of a sparse matrix.
### Example ### Example
```python ```python
import torch
from torch_sparse import transpose from torch_sparse import transpose
index = torch.tensor([[1, 0, 1, 0, 2, 1], index = torch.tensor([[1, 0, 1, 0, 2, 1],
...@@ -163,6 +165,7 @@ Matrix product of a sparse matrix with a dense matrix. ...@@ -163,6 +165,7 @@ Matrix product of a sparse matrix with a dense matrix.
### Example ### Example
```python ```python
import torch
from torch_sparse import spmm from torch_sparse import spmm
index = torch.tensor([[0, 0, 1, 2, 2], index = torch.tensor([[0, 0, 1, 2, 2],
...@@ -207,6 +210,7 @@ Both input sparse matrices need to be **coalesced**. ...@@ -207,6 +210,7 @@ Both input sparse matrices need to be **coalesced**.
### Example ### Example
```python ```python
import torch
from torch_sparse import spspmm from torch_sparse import spspmm
indexA = torch.tensor([[0, 0, 1, 2, 2], [1, 2, 0, 0, 1]]) indexA = torch.tensor([[0, 0, 1, 2, 2], [1, 2, 0, 0, 1]])
...@@ -219,10 +223,10 @@ indexC, valueC = spspmm(indexA, valueA, indexB, valueB, 3, 3, 2) ...@@ -219,10 +223,10 @@ indexC, valueC = spspmm(indexA, valueA, indexB, valueB, 3, 3, 2)
``` ```
``` ```
print(index) print(indexC)
tensor([[0, 1, 2], tensor([[0, 1, 2],
[0, 1, 1]]) [0, 1, 1]])
print(value) print(valueC)
tensor([8.0, 6.0, 8.0]) tensor([8.0, 6.0, 8.0])
``` ```
......
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