Solved by albanD in post #2 
              
              
                Hi, 
The way I would do this is to add the new layer directly on the Module: 
def get_hook_for(mod):
    mod.my_linear = Linear()
    def hook_fn(self, input):
        # mod and self are the same here, so you can use any of them
        return (self.my_linear(input[0]), )
    return hook_fn

model =…