L2 norms for each layer

Hi, I am wanting to obtain the L2 norms at each layer for all epochs. Would either of these be correct or should I access the data of the parameters to obtain the weights?

torch.sum(torch.norm(net.conv_layer1[0].weight, p=2, dim=1))
.
.
.
torch.sum(torch.norm(net.fc[0].weight, p=2, dim=1))

OR
torch.sum(net.conv_layer1[0].weight.pow(2)).pow(1/2)
.
.
.
torch.sum(net.fc[0].weight.pow(2)).pow(1/2)

Thank you in advance!