Solved by ptrblck in post #7 
              
              
                It seems you are still manipulating the activation after the forward pass finished, so you could take a look at this example to see how to manipulate them inside the hook: 
model = nn.Sequential(
    nn.Linear(1, 1),
    nn.ReLU())
model[0].register_forward_hook(lambda m, input, output: output + 100…