Can you try this minimal example in your interpreter and see if it changes the layer? In my PyTorch installation it works without problems.
import torch.nn as nn

class M(nn.Module):
    def __init__(self):
        super(M, self).__init__()
        self.m = nn.Linear(2,2)
    def forward(self, x):
        return self.m(x)

m = M()
print(m)
# should be 
# M (
#   (m): Linear (2 -> 2)
# )

m.m = nn.Linear(3, 3)
print(m)
# should be 
# M (
#   (m): Linear (3 -> 3)
# )