Solved by ptrblck in post #2 
              
              
                You could use torch.masked_select: 
k = 10
x = torch.randn(k, 2)
mask = torch.empty(k, 1, dtype=torch.uint8).random_(2)
x.masked_select(mask).view(-1, 2)