PyTorch: apply mask with different shape
I have a tensor of shape (60, 3, 32, 32) and a boolean mask of shape (60, 32, 32). I want to apply this mask to the tensor. The output tensor should have shape (60, 3, 32, 32), and values are kept if the mask is 1, else 0.
How can I do that fast?

Let t be the tensor and m be the mask. You can use:
t * m.unsqueeze(1)

