Solved by suraj.pt in post #2 
              
              
                Sequential can only be a collection of Module (or a dict where the values are Module). So you can wrap your reshape op in a module like below and include it in features. 
class ReshapeModule(nn.Module):
     def forward(self, x):
         x = x.view(x.size(0), -1)
         return x

features = nn.Se…