Solved by Eta_C in post #4 
              
              
                mask = (torch.stack([a, b, c], dim=0) == a).sum(dim=0) == 3

If a, b, c comes from a larger tensor d = torch.rand(3, 2, 2), do 
mask = (d == d[0]).sum(dim=0) == d.shape[0]