Unique by multiple dims

Is there a way for me to make the following transformation with only tensor ops? I.e. without writing my own for loop:

input:

tensor([[0, 0],
        [0, 1],
        [1, 1],
        [1, 1],
        [1, 1],
        [2, 1]])

output:

tensor([[0, 0],
        [0, 1],
        [1, 1],
        [2, 1]])

in other words, we have unique() to give me the unique scalar values but can i get the unique pairs in dim 0?

for anyone reading, turns out there is an undocumented dim arg that can be passed to the unique funciton:


https://pytorch.org/docs/stable/_modules/torch/functional.html#unique

Thanks for pointing this out!
I’ve probably forgotten to add the doc to the merge request. Will fix it as soon as possible.