ImportError: No module named weight_norm

python 2.7 anaconda installed pytorch

from torch.nn.utils.weight_norm import weight_norm

Use from torch.nn.utilsimport weight_norm

weight_norm is not a module. http://pytorch.org/docs/master/nn.html#torch.nn.utils.weight_norm