"...git@developer.sourcefind.cn:OpenDAS/mmdetection3d.git" did not exist on "683ceafb02eb72b9c2c89441d4e8572aa675cf6e"
Commit 3e02ced3 authored by rusty1s's avatar rusty1s
Browse files

0.4.0 update

parent e343fd3e
...@@ -49,22 +49,20 @@ pip install cffi torch-scatter ...@@ -49,22 +49,20 @@ pip install cffi torch-scatter
import torch import torch
from torch_scatter import scatter_max from torch_scatter import scatter_max
input = torch.Tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]]) src = torch.tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
index = torch.LongTensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]]) index = torch.tensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])
max, argmax = scatter_max(index, input, dim=1) out, argmax = scatter_max(src, input)
``` ```
``` ```
print(max) print(out)
0 0 4 3 2 0 tensor([[ 0, 0, 4, 3, 2, 0],
2 4 3 0 0 0 [ 2, 4, 3, 0, 0, 0]])
[torch.FloatTensor of size 2x6]
print(argmax) print(argmax)
-1 -1 3 4 0 1 tensor([[-1, -1, 3, 4, 0, 1]
1 4 3 -1 -1 -1 [ 1, 4, 3, -1, -1, -1]])
[torch.LongTensor of size 2x6]
``` ```
## Running tests ## Running tests
......
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