thomasverelst / dynconv

Code for Dynamic Convolutions: Exploiting Spatial Sparsity for Faster Inference (CVPR2020)
https://arxiv.org/abs/1912.03203
126 stars 14 forks source link

Questions about mask usage in convolution #13

Open antao97 opened 2 years ago

antao97 commented 2 years ago

Hi,

Thanks for your great work!

I have some questions about the mask usage in your convolution operation. I'm wondering what is the meaning to assign conv_module.__mask__ with mask. I checked that the conv_module(x) function does not consider the conv_module.__mask__ property when operating. https://github.com/thomasverelst/dynconv/blob/19e4c583b841a372b8d2eed11fa6b6139888b499/classification/dynconv/layers.py#L14-L18

Therefore, I can't get how the masks are applied in network forward propagation, such as the basicblock in https://github.com/thomasverelst/dynconv/blob/19e4c583b841a372b8d2eed11fa6b6139888b499/classification/models/resnet_util.py#L66-L70

It seems that only the mask in dynconv.apply_mask(x, mask) works.