Hi Soumith,
Thanks for the clarification. But, it still doesn’t solve my problem.
My code after your suggestion is:
x = F.relu(nn.utils.weight_norm(self.conv1(x), name='weight'))

And it still throws the same error:
*** AttributeError: 'Variable' object has no attribute 'weight'

I also ran the following sample code to test if it’s happening at other places too:
class Net(nn.Module):                                                            
def __init__(self):                                                          
    super(Net, self).__init__()                                              
    self.fc1 = nn.Linear(320, 50)                                            
                                                                             
def forward(self, x):                                                        
    x = self.fc1(x)                                                          
    x = nn.utils.weight_norm(x, name='weight')                               
    return x                                                                 
                                                                             
                                                                             
model=Net()                                                                      
model.cuda()                                                                     
x = Variable(torch.randn(64, 320).normal_(-1, 1).cuda())                         
xf = model(x)

And it’s also throwing the same error.
Thanks for bearing with me.