Skip to content

Commit 3e02ced

Browse files
committed
0.4.0 update
1 parent e343fd3 commit 3e02ced

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,20 @@ pip install cffi torch-scatter
4949
import torch
5050
from torch_scatter import scatter_max
5151

52-
input = torch.Tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
53-
index = torch.LongTensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])
52+
src = torch.tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
53+
index = torch.tensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])
5454

55-
max, argmax = scatter_max(index, input, dim=1)
55+
out, argmax = scatter_max(src, input)
5656
```
5757

5858
```
59-
print(max)
60-
0 0 4 3 2 0
61-
2 4 3 0 0 0
62-
[torch.FloatTensor of size 2x6]
59+
print(out)
60+
tensor([[ 0, 0, 4, 3, 2, 0],
61+
[ 2, 4, 3, 0, 0, 0]])
6362
6463
print(argmax)
65-
-1 -1 3 4 0 1
66-
1 4 3 -1 -1 -1
67-
[torch.LongTensor of size 2x6]
64+
tensor([[-1, -1, 3, 4, 0, 1]
65+
[ 1, 4, 3, -1, -1, -1]])
6866
```
6967

7068
## Running tests

0 commit comments

Comments
 (0)