Does that mean, the change would be like so:
def mod_neurons(self, module, module_in):
        # halve neuron values
        module_in = module_in * 0.5

# register hooks
hook_handles = []

for layer in model.modules():
    # only for the Conv2D
    if isinstance(layer, torch.nn.modules.conv.Conv2d):
        handle = layer.register_forward_pre_hook(mod_neurons)
        hook_handles.append(handle)