We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e343fd3 commit 3e02cedCopy full SHA for 3e02ced
README.md
@@ -49,22 +49,20 @@ pip install cffi torch-scatter
49
import torch
50
from torch_scatter import scatter_max
51
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]])
+src = torch.tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
+index = torch.tensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])
54
55
-max, argmax = scatter_max(index, input, dim=1)
+out, argmax = scatter_max(src, input)
56
```
57
58
59
-print(max)
60
- 0 0 4 3 2 0
61
- 2 4 3 0 0 0
62
-[torch.FloatTensor of size 2x6]
+print(out)
+tensor([[ 0, 0, 4, 3, 2, 0],
+ [ 2, 4, 3, 0, 0, 0]])
63
64
print(argmax)
65
--1 -1 3 4 0 1
66
- 1 4 3 -1 -1 -1
67
-[torch.LongTensor of size 2x6]
+tensor([[-1, -1, 3, 4, 0, 1]
+ [ 1, 4, 3, -1, -1, -1]])
68
69
70
## Running tests
0 commit comments