Solved by JuanFMontesinos in post #4 
              
              
                You can iterate over the parameters and filter. 
Like 
for name,param in model.named_parameters():
     if name==condition:
       prune