Solved by ptrblck in post #3 
              
              
                Alternatively, you could use nn.ModuleList, which acts like a list, but registers your modules: 
self.linears = nn.ModuleList([nn.Linear(10, 10) for _ in range(10)])