Solved by rap1ide in post #2 
              
              
                Meanwhile I tinkered some code which works: 
import functools
import torch

def get_module_layers_and_keychains(module):
    """ Returns all layers of a pytorch module and a keychain as identifier.
        e.g.
        ...
        (['features', '0', '5'], nn.ReLU())
        ...
        (['classifier…