removeDuplicates doesn't seem to work
AlexisBRENON opened this issue · comments
Alexis BRENON commented
removeDuplicates
doesn't seem to remove anything...
Example:
th> x = torch.rand(1,5)
[0.0000s]
th> y = x:repeatTensor(5,1)
[0.0005s]
th> print(y)
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
[torch.DoubleTensor of size 5x5]
[0.0005s]
th> manifold.removeDuplicates(y)
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
0.0463 0.4599 0.1440 0.2752 0.2289
[torch.DoubleTensor of size 5x5]
{
1 : 1
2 : 2
3 : 3
4 : 4
5 : 5
}
[0.0012s]
th>
As you can see, all samples of y
are returned while I expect to get only one (as they are all the same).
Do I misunderstand the use of this function ?
Kind regards,
Alexis.