How can i select feature map channels through mask map

for example
mask_map.shape=(1,H,W)
feature_map.shape=(1,C,H,W)
I use a picture to explain my question
in this , I make H=2,W=2,C=2

Does broadcasting work if you reshape the mask?

reshaped_mask = mask.reshape(1, 1, H, W)
out = feature_map * reshaped_mask