Solved by ptrblck in post #2 
              
              
                You could index a by keeping all samples, which meet the requirement b!=1: 
a = torch.randn([10, 80, 2])
b = torch.randint(0, 2, (10,))

res = a[b!=1]