Hallo All
following Tensor is given:
a = torch.tensor([[ 1, 3, 7, 12];[ 2, 7, 8, 16];[ 3, 5, 6, 13];[ 1, 2, 8, 6],…])
would like have:
Coulum 0:
1 => distance(idx) 3 to next 1
3 => distantce(idx) 2 to next 3
7 => distantce(idx) 1 to next 7
12 => distantce(idx) .. to next …
b = torch.tensor([1, 3],[3, 2],[7,1],[12,0])
Coulum 1:
2 => distantce(idx) 2 to next 2
7 => distantce(idx) .. to next …
8 => distantce(idx) 2 to next 8
16 => distantce(idx) .. to next …
b = torch.tensor([1, 3],[3, 2],[7, 1],[12, 0]
so that we have [number, distance]
b = torch.tensor([1, 3],[3, 2],[7, 1],[12, 0];
[2, 0],[7, 0],[8, 2],[16, 0];.....)
…..