Try this:
aa = torch.tensor([[1, 2, 2], [3, 3, 3]])
unq, groups = aa.unique_consecutive(dim=1, return_inverse=True)
groups is:
tensor([0, 1, 1])
which are the group assignments for the first row only! expected groups to be of shape [2, 3], with the group assignments for each row… Is this a bug? Any way of achieving what I intended in an efficient way?