I tried multiple other things:
tnsr = torch.Tensor([1,2,3,4])
mask = torch.BoolTensor([False, False, True, True])
a = tnsr * mask  # Gives tensor([0., 0., 3., 4.])
b = torch.masked_select(tnsr, mask)   # Gives tensor([3., 4.])
c = tnsr[mask]     # Gives tensor([3., 4.])

I’m still not sure which of these options to choose.