I have a torch.tensor of shape (n,m) and I want to remove the duplicated rows (or at least find them). For example:
t1 = torch.tensor([[1, 2, 3], [4, 5, 6], [1, 2, 3], [4, 5, 6]])
t2 = remove_duplicates(t1)
t2 should be now equal to tensor([[1, 2, 3], [4, 5, 6]]), that is rows 1 and 3 are removed. Do you know a way to perform this operation?
I was thinking to do something with torch.unique but I cannot figure out what to do.