Solved by ptrblck in post #2 
              
              
                The error is raised by nn.ModuleList, which doesn’t implement a forward method, but acts as a list with the additional property to register all parameters and buffers into the parent nn.Module. 
You could use another nn.Sequential container and .add_module instead: 
net = nn.Sequential(
    nn.Linea…