Solved by ptrblck in post #2 
              
              
                Could you check, if all passed arguments are nn.Module objects, i.e. denseBlocks, links, and classifier? 
It’s unclear from the error message which module is raising this issue and the code looks generally alright. 
Wrapping the modules in nn.Sequential inside the forward is unusual, but shouldn’t c…