How to apply weight norm to a whole module?

without having to specify the weight name?

maybe module.named_parameters will help

for name,param in model.named_parameters():
    if name.endswith('weight'): weight_norm(param)
2 Likes