Your code should work to check for all batchnorm layers in the model.
Would you like to store the affine parameters only (weight and bias) or also the running estimates?
Where are you stuck at the moment? Are you trying to append all wanted parameters to a list?