Thank you for your answer. Now I want to know why your solution
torch.norm(model[0].weight, p=1)

doesn’t work for below network?
 l1_norm = torch.norm(model[2].weight, p=2)
TypeError: 'Net_test' object is not subscriptable

class Net_test(nn.Module):

    def __init__(self):
        super(Net_test, self).__init__()
        self.fc1 = nn.Linear(10, 10)
        self.fc2 = nn.Linear(10, 2)

    def forward(self, x):
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x


model = Net_test()

x = torch.randn(10, 10)
target = torch.empty(10, dtype=torch.long).random_(2)
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=1e-3)

for epoch in range(10):
    optimizer.zero_grad()
    output = model(x)
    loss = criterion(output, target)
    l1_norm = torch.norm(model[2].weight, p=1)
    loss += l1_norm
    loss.backward()
    optimizer.step()

    print('Epoch {}, loss {}, mat0 norm {}'.format(
        epoch, loss.item(), l1_norm.item()))