Hi,
The thing is that if named_parameters does not work properly, then .parameters doesn’t either, and that could be a problem if you use it to create your optimizer. Check the exemple below of what will and what won’t work.
class MyLayer(nn.Module):
    def __init__(self, arg):
        super(MyLayer, self).__init__()
        self.linear = nn.Linear(...) # that will work
        self.linears = nn.ModuleList(nn.Linear(...), nn.Linear(...)) # that will work
        self.wrong_linears = [nn.Linear(...), nn.Linear(...)] # that will NOT work
        self.wrong_linears_2 = {1: nn.Linear(...), 2: nn.Linear(...)} # that will NOT work

        # And similarly for nn.Parameter !
        # Also anything saved as `torch.Tensor` or `torch.autograd.Variable` will NOT work

    def forward(self, args):
        # some code