I have a network that consists of batch normalization (BN) layers and other layers (convolution, FC, dropout, etc)
I was wondering how we can do the following :

I want to freeze all the layer and just train the BN layers
freeze the BN layers and train every other layer in the network except BN layers

My main issue is how to handle freezing and training the BN layers