Solved by gphilip in post #2 
              
              
                What do you mean by “nothing gets printed”? If you add the line 
print("Hi")

at the place where you were trying to print layers[0], does it print anything? (It should …) 
To know the dimensions that go into the layer you added, you can try something like this: 
x = self.layer1(x) ## the code exist…