Hi,
Such chaining of each layer one by one is only expected to work if the original module is a nn.Sequential() as this is how the forward method is implemented here 18.
For general modules, you should check how the forward method is implemented to know how they should be used.
In the case of resnet, the repo you linked seem to use the torchvision version, whose forward function can be found here 15. It looks like by change, because the modules were defined in the right order, it works up until the .reshape(). But this is only by chance and is not guaranteed.
I think the best way to access internal values here would be to change the forward method to either return or print the intermediate values you’re interested in.