I’m not sure if I understand the use case correctly, but you could use OR instead of any stacking operation:
x1 = torch.tensor([[[0, 1, 1],
                    [0, 1, 0],
                    [0, 1, 1]]])
x2 = torch.tensor([[[1, 0, 0],
                    [1, 0, 1],
                    [1, 0, 0]]])
x3 = x1 | x2
print(x3)
> tensor([[[1, 1, 1],
           [1, 1, 1],
           [1, 1, 1]]])