I have a tensor some elements of which I would like to set to zero using 2 binary masks.
If I had a single mask, I could do the following:
input_tensor[mask] = 0
where mask is a tensor containing binary values and is the same size as input_tensor
However, given two masks, the following would be invalid:
input_tensor[mask_1][mask_2] = 0
due to input_tensor[mask_1] and [mask_2] being different sizes.
I realise that I could use:
input_tensor[mask_1*mask_2] = 0
However, this does not seem like the “correct” way of doing this, and I was wondering if there is a better solution?