So let’s get back to my tasks. I have to compose MSE loss with L1-norm regularization (among all layers’ weights)
I know how to iterate over all layers
    for name, W in model.named_parameters():
            l1 = W.norm(p=1)

But how to add all weights to Variable
The following methods don’t work

    x = Variable(self.enc_linear1, requires_grad=True)
    x = Variable(W, requires_grad=True)